Introduction

Programmer Studio is not just an editor! Programmer Studio is a fully integrated visual development environment designed to meet the requirements of those programmers developing on any platform, Windows, UNIX, MPE, OS/400, VMS, etc.

Target Audience

Programmer Studio can be used by virtually any programmer working with text based source files regardless of the programming language or target platform. This allows programmers developing on any platform to benefit from the many familiar time-saving features provided by Windows, whilst still using their existing server-based compilers and debuggers.

Unlike most professional development environments, Programmer Studio is not tied to any specific programming language. Through the highly customizable environment you can start working in any one, or all, of the 30+ ready to use languages or simply create your own.

Through an integrated approach to editing, compiling and debugging, Programmer Studio makes it easy to develop software regardless of whether the file is simply on your PC or located on a remote server running a legacy operating system.

FTP and TELNET

Programmer Studio uses the established protocols FTP (File Transfer Protocol) and TELNET to ensure that many of the features found in other Windows development environments can be reproduced on a remote server. FTP and TELNET are supported by the vast majority of server operating systems regardless of age.

By integrating support for both FTP and TELNET, Programmer Studio presents a seamless interface to open and edit files, and execute compilers and debuggers. When comparing this to a conventional development process which would usually involve juggling a PC editor, file transfer utility and terminal window, Programmer Studio’s advantages become immediately apparent.

HPe3000

Programmer Studio provides an even greater level of support for those users working on the more complex HPe3000 server platform. Using our custom file access protocol - WTRSH, Programmer Studio is able to access every type of file, including COPYLIB’s, SPOOL files and even Qedit® files.

See Also

  • Key Features


Key Features

  • Standard 3-part application environment reduces the learning curve of new users familiar with existing Windows development products.

  • File ‘tabs’ not only allow you to switch between open files with a single-click but provide an immediate visual representation of those files already open.

  • The line on which the cursor is located can be highlighted to ensure the current line is quickly identifiable.

  • Color syntax highlighting provides a visual clue to the validity of keywords, comments and quoted strings as you type.

  • Quickly switch between languages embedded in the same source file. Color syntax highlighting is used to visually differentiate between each embedded language.

  • Split windows, provide for each editor window to be split up to 8 times vertically using the ‘handle’ appearing above the vertical scroll bar.

  • Text can be selected in vertical columns or blocks. The selected text can then be indented or, using the mouse, moved to a new position.

  • Mark-up languages such as XML and HTML can be configured to enable color syntax highlighting within “<” and “>” tags only.

  • Programming language support is easily customizable, create your own languages or modify one or the 30 ready to use definitions.

  • CodeAware technology provides a detailed view of the syntax of individual files or entire projects. Navigate the syntax of a file or project as a collapsible tree view, double-clicking to quickly view the actual syntax definition.

  • Type info provides detailed definition information by simply placing the mouse pointer above a recognized expression.

  • Parameter tips provide argument highlighting when typing functions and procedures.

  • Auto complete provides a list of possible recognized expressions to complete a partial string.

  • Auto list members provide a list of object/structure members when the recognized delimiter is typed after a known variable.

  • Bracket Highlighting provides a visual clue to the scope covered by various bracket/brace combinations. Placing the mouse pointer over a bracket/brace visually identifies the matching pair. This is also available while typing.

  • Extensive COBOL support, automatically insert new lines in sequence or renumber a file when saving. Support for COBOL’85 line tags, enable automatic tag update when modifying lines or re-tag a range of lines.

  • Files containing line numbers are automatically detected, providing support for inserting new lines in sequence or renumbering existing lines.

  • Virtually unlimited undo and redo based on available Windows resources.

  • Use custom tab positions, ruler and visual guide lines to help format text to fixed character positions. This includes extensive support for interchanging tab and space characters.

  • Extensive reformatting options provide sort, change case and simply comment/uncomment a selection with a single click.

  • Support for regular expressions in searching, color syntax highlighting and compile error detection.

  • Compile source files with just one click. Use predefined compiler configurations to detect each individual error reported. Double-click on an error or step through each error to open and highlight the source file line referenced. Customize error detection to support any compiler/lint tool.

  • Create projects to organize your files based on program, language, user – you name it. Assign compilers to each file or groups of files; customize each compile command if necessary. Build commands can be assigned to project folders for large, multi-server, projects. You can even choose to keep your project files on the server*.

  • Interactively control remote debuggers using custom interface libraries. Using the code editor and menus you can quickly insert breakpoints, step through code, quick-watch expressions and even display the call stack and locals. Currently supported debuggers include; GDB, WDB, DBX, XDB and PERL.

  • Use an unlimited number of bookmarks to identify lines of interest in any number of files. Bookmarks for project files are saved within the project.

  • Check the spelling of a selection, a file, or even just the text appearing in quoted strings.

  • Use Visual File Compare to analyze the differences between two files. The side-by-side display provides a simple visual representation of any differences allowing either file to be quickly synchronized.

  • Support for individual server character sets ensures that files are saved exactly as edited.

* Not supported on MPE using FTP


Introducing Programmer Studio

This chapter will introduce you to the many components which make up Programmer Studio’s integrated visual development environment. For those users new to Programmer Studio it is important to remember that it is as easy to edit a PC file as it is to edit files on a remote server. So if you want to start exploring the IDE right away, why not open a familiar file on your PC?

Getting started in Programmer Studio is as easy as opening an existing file or creating a new one. However to ensure you get the most out of Programmer Studio, you should understand the basic concepts behind the IDE (integrated development environment) to determine which features will benefit you the most.


Visual Development Environment

Programmer Studio has been designed to include many familiar features included in popular Windows development tools. This allows new users to become immediately productive while reducing the learning curve for programmers new to Windows.

Here are some of the most commonly used components within the Programmer Studio environment:

The document window (on the right) displays the code or hex editor for the current file you are editing. The current file’s name is displayed immediately above the document window in a ‘tab’. You can click on names appearing in the tab area to switch between open files.

Note

Placing the mouse pointer over a ‘tab’ displays detailed file properties in a tool-tip.

The workspace window (on the left) displays the structure or class view for the current project or the syntax of the current file. The ‘tabs’ immediately above the workspace window can be used to switch between these three different views.

The Output Window (at the bottom) displays real-time output. This may be in the form of compiler output, the results of a find-in-files or the status of the current debug session. The ‘tabs’ immediately above the output window can be used to switch between the different views available.

The toolbar contains buttons, popup menus and drop-downs to let you view the document window in different ways, set view options, and access popular operations for which you would normally use the menus. The toolbar is fully customizable, allowing you to determine the buttons displayed and the position of the toolbars.


Menu Bar

This section will provide a brief description on the items which are available from the menu. The order or appearance of menu items may change between versions of Programmer Studio. If you have any questions regarding the operation on specific menu items please contact Programmer Studio Technical Support.

What do want to know more about ?

  • File Menu

  • Edit Menu

  • View Menu

  • Format Menu

  • Project Menu

  • Build Menu

  • Debug Menu

  • Tools Menu


File Menu

The File menu will be familiar to all Windows users. This menu contains all items which perform operations on the current, new or unopened files. This section discusses the items which may not be familiar.

New Project

This displays the New Project wizard. The wizard will take you through the steps required to create a new project file. These include selecting the location of the files in the project, primary file type and compiler, etc.

Open Project

Selecting this option displays the Programmer Studio file open dialog box to select the project file to open.

Close Project

Closes the current project and saves the current class view and bookmarks.

Save All

Saves changes to all modified files. If the current project settings have been modified, the project file is saved also. Programmer Studio will prompt for the name of any untitled file name before saving.

Send as Attachment

Creates a temporary version of the current file and attaches it to a new email messages. This uses your default email program (MAPI client).


Edit Menu

The Edit menu contains items for general text editing, such as options for undo and redo as well as clipboard operations. This section discusses the items which may not be familiar.

Select Line

This option selects the entire contents of the current line. If this is a COBOL, or other numbered file, the line number and line tag are also included in the selection.

Note

The line number and line tag are not included when the line is copied to the clipboard.

Find in Files

Find in Files allows you to search a number of files for a specific text string. The location of the search may be a local directory on the PC or a remote server directory. You can cancel any find in progress by selecting Stop from the View menu.

Go To

The Go To sub-menu provides options to move around within the current file or project class view. Having moved from one position to the next, the options Back and Forward can be used to retrace your steps, just as you can in a web browser.

Bookmarks

The Bookmarks sub-menu provides options to add, remove and navigate between the bookmarks in the current file.

List Members

List Members is one of the features of CodeAware. When selected, this feature examines the expression at the current insertion point, and after determining that the expression represents a known object/structure, the elements of this known object/structure are displayed in a popup list.

Type Info

Type Info is one of the features of CodeAware. When selected, this feature examines the expression at the current insertion point and displays any information on the expression. For variables this would display the type, and for functions or procedures, the parameter list.

Parameter Info

Parameter Info is one of the features of CodeAware. When selected, this feature examines the expression at the current insertion point, and after determining that the expression represents a known function/procedure, the parameter layout is displayed as a tool-tip. As each parameter is completed, the next required parameter is displayed in bold.

Complete Word

Complete Word is one of the features of CodeAware. When selected, this feature displays a list of known variables, functions, etc. in a popup list. If the cursor is immediately placed at the end of an incomplete word, the first item matching the characters of the incomplete word is highlighted.


View Menu

The View menu contains items which affect the presentation of the current file. Selecting options from this menu will only be reflected on the current file. This section discusses the items which may not be familiar.

Cursor Highlight

The Cursor Highlight displays the current line (the line on which the cursor is located) using a different background color. This ensures the attention of the user is immediately drawn to the current line when the position of the cursor would not normally be so obvious.

Selection Tips

When enabled, Selection Tips display a tool-tip whenever a range of text is selected. When a selection is on a single line, the tool-tip displays the starting and ending character position and the number of characters included in the selection. When a selection includes multiple lines, the tool-tip displays the number of lines selected.

Bracket Highlighting

When enabled, bracket, square bracket and curly brace characters, are highlighted in pairs when the mouse is positioned above or when typing a bracket or brace character. This can be invaluable as an instant visual clue to the completion of an expression using brackets or when attempting to determine the scope of encapsulated code.

Guide Lines

Guide Lines provide an ideal way to mark the position of a character (relative to the left margin) using vertical indicator lines. These guide lines can be especially useful when enforcing fixed levels of indenting in source code or when editing ASCII data files in which a single line represents a data record.

Line Numbers

This option allows you to display line numbers against each line in a file. If the current file included numbered lines, such as COBOL, the numbers displayed are not editable.

Line Tags

This option allows you to display the COBOL line tags for each line.

Contents As

This sub-menu provides a list of the different languages which may be embedded in the current file as identified by the file’s file type. Selecting an item from the menu updates the current color syntax highlighting to visually represent the chosen language component apart from the surrounding text.

Stop

Selecting Stop will cancel the current load or save.

Reload

This option will reload the current file; any existing bookmarks are preserved.

Refresh Syntax

This option will update the CodeAware database for the current file, updating the CodeAware drop-down on the toolbar and the tree view in the Syntax tab of the Workspace window. If the current file is included in the current project, and the current file’s file type is identified to be included, the project’s ClassView.will be updated also.

Network Trace

This option displays a Network Trace tab in the Output window. The Network Trace tab displays the details of all FTP protocol traffic.

Server Connections

This displays the Server Connections dialog box which lists all server profiles and provides details of connection status. Using the Server Connections dialog box, you can also disconnect specific servers.

Properties

This displays the Properties dialog box for the current file.


Format Menu

The Format menu contains items which affect the format of the contents of the current file.

Tabs

This displays the Tabs dialog box in which you can specify the fixed positions and default tab size used in the current file. Use the Apply button to update the current file dynamically to determine how your selection will be displayed.

Tabify

This option allows you to replace a specified number of consecutive space characters with a single tab character. This feature is available for a selection or the entire file.

Untabify

This option allows you to replace single tab characters with a specified number of consecutive space characters. This feature is available for a selection or the entire file.

Increase Indent

This option will indent the first non-space (including tabs) character to the next tab position to the right for each line in the selection. This will typically involve inserting a tab character, however if the current file’s file type specifies that tabs must be inserted as spaces, the correct number of consecutive space characters will be inserted to reach the next tab stop.

Decrease Indent

This option will position the first non-space (including tabs) character to the next tab position to the left for each line in the selection. This will remove either a single tab character or multiple spaces.

Increase Indent by 1

This option will move the first non-space (including tabs) character to the right by one character position for each line in the selection.

Decrease Indent by 1

This option will move the first non-space (including tabs) character to the left by one character position for each line in the selection. Tab characters will be converted to consecutive space characters as required.

Trim Selection

This option will remove all trailing space and tab characters appearing at the end of each line in the selection or the entire file.

Change Columns

Change Columns allows characters to be inserted, replaced or deleted by column position. The change columns feature is very useful when working with ASCII data files in which a record is represented as a single line.

Change Case

This option allows you to change the case in which alphabetic characters are represented in the current selection. The selection can be converted to, upper case, lower case, sentence case, etc.

Sort

This option allows the current selection or file to be sorted, line-by-line, based on a number of options specified by the user.

Comment Selection

This option will insert the characters required to place the current selection within a language defined comment. If the language of current file’s file type specifies a number of comment styles, you are prompted which to use.

Uncomment Selection

This option will attempt to determine what comment characters have been used to enclose the current selection, and then remove these characters.

Renumber Lines

For COBOL and files containing line numbers, this option allows a range of lines to be renumbered based on options specified by the user.

Set Line Tag

This option allows the user to set the COBOL line tag for the current line, selection or entire file. The line tag may be specified by the user or selected from a list of pre-defined tags which use special tokens to represent date, etc.

Tag Modified Lines

When enabled, this option will update the COBOL line tag on each line modified using the tag specified. If a COBOL line tag has not been specified in the current file’s File Type, the user is prompted for the COBOL line tag to use.


Project Menu

The Project menu contains items which affect the contents, structure and properties of the current project.

New Folder

This option inserts a new, empty, folder into the current project. Folders provide an ideal way to organize project components which can be files or other project folders. Folders, like the project itself, may also be assigned properties than can be inherited by the files and folders they contain.

Add Files to Folder

This option will prompt you to select one or more files using the File dialog box. Once selected, an entry for each file highlighted will be added to the current project folder. These entries represent a short-cut to the file, as the project does not include the files themselves.

Insert File into Project

This option will add the current file into the current project. If the current file was opened with a specific file type, this will be specified in the project settings for the file.

Clear ClassView

This option will delete the existing CodeAware database for the current project. The ClassView will then be updated as individual project files are opened.

Settings For

This option will display the project settings for the current file.

Settings

This option will display the settings for the current project.


Build Menu

The Build menu contains items relating to compiling files and building programs. This section discusses the items which may not be familiar. Executing a compile or build will result in a series of commands being performed on the specific file’s host platform. For Windows files, the command(s) are executed as a console mode application; for server files, a TELNET session is used.

Compile

This option will execute the compile command for the current file or selected project file. If the file is not included in the current project, you are prompted for the compiler to use. Select Cancel from the Build menu to terminate the compile.

Build

This option will execute the build command for the current file or project folder. The source of the build command (project or project folder) is displayed in the menu item text. Select Cancel from the Build menu to terminate the build.

Clean

This option will execute the command specified in the project to delete the intermediate files created when compiling the current file (or group of files when selected for a project folder).

Select Compiler

For non-project files, this option allows you to select the compiler you want to use when compiling the current file.

Cancel

Selecting this option will attempt to cancel any compile or build commands in progress. If the command is being executed in Windows, the console process is terminated. If the command is being executed on a remote server, a CTRL+BREAK key press is sent to the TELNET session. Selecting cancel again will terminate the TELNET session.


Debug Menu

The Debug menu contains items relating to debugging files or programs. This section discusses the items which may not be familiar. The availability of items in this menu is determined by the debugger being used. If a feature is not supported by the debugger the menu item will remain disabled.

Go

This option will start the program/file in the debugger. The debugger will be suspended when it reaches any specified breakpoints or the end of the program. You can use the Break item in the Debug menu to attempt to suspend the program within debugger while it is busy.

Step Into

This option will start the program/file in the debugger but will be suspended at the first executable line. This line will then be highlighted in the code editor if possible.

Attach to Process

Selecting this option will prompt you for the ID of the existing process you wish to debug. After entering a valid process ID the debugger is started with instructions to connect to the specified process. You can use the Break item in the Debug menu to attempt to suspend the program within debugger while it is busy.

Continue

This will continue the execution of the program/file within the debugger.

Restart

This will restart the debugger keeping existing breakpoints.

Stop Debugging

This will stop and exit the debugger.

Break

This will attempt to suspend the execution of the program/file within the debugger, locating the current statement and highlighting this within the code editor. In the event the current statement does not identify a filename and line number, the call stack is displayed.

Kill Debug Session

This will simply close the active TELNET session, which in turn should terminate the debugger and target on the server. This option should be used with caution and only in cases where Stop Debugging fails.

Step Into

This will attempt to step into the sub-procedure/function located on the current statement in the code editor. If the current statement does not identify a sub-procedure/function, this may fail or the debugger may perform a Step Over (depending upon the debugger).

Step Over

This will attempt to execute the code represented by the current statement in the code editor and break execution at the next statement in the current file. If there isn't a next statement in the current file, this may fail or the debugger may highlight the next executable statement (depending upon the debugger).

Run to Cursor

This will attempt to set a temporary breakpoint at the statement on which the cursor is located in the code editor and then continue program execution.

Set Next Statement

This will attempt to move the current statement to the statement on which the cursor is located in the code editor without executing code in between. This should be used with caution as it may leave the debug target in an unusable state.

View Call Stack

This will display the current call hierarchy for the current statement.

View Locals

This will display the contents of all local variables (if applicable to the programming language) in their native format.

Toggle Breakpoint

This will insert a new breakpoint in the debugger at the line on which the cursor is located in the code editor. If the current line represents an existing breakpoint, that breakpoint is deleted.

Breakpoints

This will display a dialog box in which you can edit, remove or add to the existing breakpoints specified for the current debug session.

Show Next Statement

This will highlight the debugger’s current statement in the code editor, opening any necessary files.

Quick Watch

This will display the Quick Watch dialog box. This evaluates the currently selected text or the keyword at the cursor in the code editor. The results of the evaluation will then be displayed in their native format.


Tools Menu

The Tools menu contains items which do not belong on other menus or are relating to the configuration or customization of Programmer Studio. This section discusses the items which may not be familiar. In addition, the Tools menu can also include commands created by you.

Spelling

Selecting this option will invoke the spell checker for the current file.

Visual File Compare

Selecting this option will compare two files based on options specified. Following a successful comparison, the two files are displayed side-by-side with any differences indicated as colored lines.

File Types

This displays the File Types configuration dialog box.

Server Profiles

This displays the Server Profiles configuration dialog box.

Languages

This displays the Languages configuration dialog box.

Compilers

This displays the Compilers configuration dialog box.

Preferences

This displays the application preferences dialog box.


Server Profiles

Programmer Studio has been designed so that developers many continue programming on virtually any platform, using their existing compilers and debuggers, while still benefiting from many of the time-saving user interface features which Windows offers.

Indeed, it can be argued that users may quickly become unaware that they are even working on a UNIX, VMS, OS/400 or MPE system as the integrated visual development environment provides many features which conventionally required multiple programs and command prompt sessions.

Note

MPE (MPE/iX), VMS and OS/400 are proprietary operating systems used on the Hewlett-Packard HPe3000, Compaq DEC/VAX and IBM iSeries (AS400) servers respectively.

Related Topics

  • File Naming Convention

  • Accessing Files

  • Executing Commands

  • Add Server Wizard

  • Security

  • Active Server Profiles

  • Configuring a Server Profile


File Naming Convention

The names for files which can be accessed via the normal Windows file system (i.e. using Notepad) are displayed just as they would be in any Windows application.

In order to achieve this level of transparency when dealing with remote servers however, Programmer Studio employs a naming convention for file names similar to the internet URL. Each file name is display in UNIX format regardless of OS type, and is prefixed by the name of the server profile which defines the server connection details.

It is important to understand that the server profile name is not necessarily the same as the server's host name, although this is a popular choice. The profile name is assigned by the user and can identify any host name or IP address.

UNIX

For UNIX compatible operating systems (Linux, HP-UX, Solaris, AIX, etc) the file name displayed is identical to native file name, with the server profile prefix. For example:

/dev/usr/example.txt

Assuming the server connection details were defined in profile hpux, this file name becomes:

//hpux/dev/usr/example.txt

Note

This assumes the FTP server is not configured with a virtual root which is different from that of the system root directory.

MPE

For MPE systems, the names of native MPE files are converted into their POSIX equivalent. For example:

WTRSHC.PUB.SYS

Is converted to the following file name:

/SYS/PUB/WTRSHC

Files from the POSIX file system obviously remain unchanged. Once converted, the server profile name is then prefixed to the file name. For example:

//hpix/SYS/PUB/WTRSHC

VMS

For VMS systems, the native file names are converted into a UNIX friendly format. For example:

[000000.DEV]EXAMPLE.TXT

Is converted to the following file name:

/DEV/EXAMPLE.TXT

Once converted, the server profile name is then prefixed to the file name. For example:

//vms/DEV/EXAMPLE.TXT


Accessing Files

Programmer Studio uses network protocols to transfer files to and from the PC to provide identical functionality when editing files regardless of their location. Typically this involves using the FTP protocol, although Programmer Studio includes our WTRSH server software specifically for HPe3000 platforms.

What is FTP

FTP, or File Transfer Protocol, is the main Internet protocol for managing and transferring files on a remote machine. Using FTP, Programmer Studio is able to view remote directory listings and transfer files without requiring any additional interaction from the user.

Transfer Mode

Although FTP is a relatively simple protocol, there is one area where both new and experienced users may become confused. When transferring files, FTP supports a mode option which is used by the server to determine how to format each file transmitted. Programmer Studio supports two FTP modes, ASCII and binary.

The ASCII transfer mode instructs the server to transfer a file, line-by-line, terminating each line sent with a carriage return and line feed. Although the actual format of the file on the server remains unknown, this transfer mode is ideal as the format of a file can be assured.

Note

Each server profile provides an option to set ASCII as the default transfer mode. It is recommended that this option is enabled for all non-UNIX systems except HPe3000.

The binary transfer mode, in contrast, instructs the server to transfer a file as a stream of bytes. This mode offers the greatest benefit for users as Programmer Studio can automatically determine which editor (hex or code) should be used to view the file. Currently this mode only works reliably when transferring files from UNIX platforms.

HPe3000

For HPe3000 users using FTP, Programmer Studio provides an automatic transfer mode. Before the transfer of each file begins, Programmer Studio queries the build parameters of each file. Using the MPE file mode, the transfer mode is then switched between ASCII and binary as required.

Perhaps the most important consideration for users should be that FTP is not really suited to the record-based file system employed by the HPe3000. Taking a very simplistic approach to the HPe3000 file system, each file can be described as containing one or more records which may, or may not, be of the same length. This presents a problem when using FTP as the protocol does not provide a mode in which a file may be sent including the length of each record. Without knowing the length of each record, the file cannot therefore be saved.

While this makes it impossible to create or save binary files, ASCII mode files (with either fixed or variable record lengths) may be edited as the FTP server on the HPe3000 terminates each record with a carriage return and line feed.

What is WTRSH

While FTP provides all the features necessary to navigate and transfer files on most platforms, the HPe3000 (a mini-computer from Hewlett-Packard) employs a very unique file system which is not adequately supported by FTP. WTRSH provides a solution to this problem by implementing a proprietary protocol which allows all HPe3000 file types to be opened, save or created.

In addition to simply supporting the various MPE file modes, variable, fixed, ASCII, binary and byte-stream files, WTRSH also supports SPOOL files, transparent COPYLIBs and even access to Qedit® files.

For more information on WTRSH, where to get the software see WTRSH.

Server Character Sets

One final consideration when editing files is the character set represented by the server on which the file exists. As the ASCII character set is standardized for the first 128 characters (of a maximum of 256) only, the remaining characters can be interpreted very differently between the PC and the remote server.

For example, the UK currency symbol ‘£’ appears at position 163 in the Windows (ISO-Latin-1) ASCII character set. In contrast, the same symbol appears at position 187 in the HP-Roman-8 ASCII character set (used by both HPe3000 and HP-UX servers).

To allow files to be edited correctly, each server profile must specify the ASCII character set supported. This allows Programmer Studio to ‘map’ characters between the host and Windows ASCII character sets while a file is open. In those situations where a character cannot be converted when either loading or saving, Programmer Studio displays a warning to the user.


Executing Commands

To provide the ability to execute commands to compile or build and even control a remote debugger, Programmer Studio uses the TELNET protocol to create a remote VT (virtual terminal) session on the server. Once successfully authenticated as a user, the command prompt provides access to all the functionality Programmer Studio requires.

What is TELNET

TELNET is the main Internet protocol for creating a connection with a remote machine. It gives the user the opportunity to be on one computer system and do work on another, which may be across the street or thousands of miles away.

Authentication

Unfortunately, unlike the agreed format of the TELNET protocol, the interaction between the user and the remote machine are undefined once a connection has been established. Typically, following a connection, the remote server will prompt for the user to authenticate themselves which usually takes the form of a user name and password.

As these authentication prompts differ drastically between servers, Programmer Studio requires each server profile to determine the text of each prompt expected, and then the desired response. You can also specify which responses the user should be prompted for during the login process.

Detecting the Command Prompt

Just as with initial authentication, following a successful login, the format of the command prompt displayed to the user can also change dramatically between servers. Detection of the command prompt is perhaps the most vital part of any server profile; this is used to determine that each command executed has been completed and the server is ‘ready’ for the next command.

Using Regular Expressions

Just as with the DOS prompt, most server operating systems provide the facility to create a dynamic command prompt. This may display the current user name, date, time or the current working directory. To detect such unpredictable text, regular expressions are used to identify the pattern of a prompt, the components which remain constant and the format of those which change.

Take the following command prompt for example:

130[/home/greg]$

This command prompt displays the command index (the number of commands executed by this user), the current working directory and some constraining characters for readability.

This can be described using the following regular expression:

[0-9]+\[.*\]\$

This regular expression describes the variable components of the command prompt as a “ranges of digits” and “all characters up to…” while including the static characters, “[“, “]” and “$”.

Note As the characters, “[”, “]” and “$”, are special regular expression format variables, the back-slash character is prefixed to determine the characters should be matched literally.

Using regular expressions it then becomes possible to detect the command prompt regardless of what the result of a command may be. The obvious exception to this however is if the prompt should be changed dramatically.

Changing the Command Prompt

There will be situations when the format of the command prompt is so simple that it can not be adequately identified from other output normally appearing in command output. In these situations a server profile can be configured to execute a command following successful authentication which changes the format of the prompt.

Session Wizard

Obviously specifying the correct format for prompts and responses during authentication and then creating an expression to detecting the command prompt is a complex task.

To help, Programmer Studio provides a Session Wizard. The session wizard creates a TELNET session on the server and displays the text received in order for the user to easily determine what constitutes a prompt and what the correct response is. Once authenticated, the session wizard attempts to determine if the server uses a variable prompt and, if so, helps create a regular expression.

The session wizard may be run separately or as part of the Add Server Wizard.


Add Server Wizard

The Add Server Wizard is designed to be used by new and experienced users alike as the starting point for creating server profiles. The wizard has been specifically designed to ensure that the minimum settings required are completed before you begin to use the new server profile.

Before using the Add Server Wizard it is important that you have the answers to the following questions:

  • What is the host name or IP address of the server?

  • What is your user name and password on the server?

  • Does the server use non-standard port numbers for FTP or TELNET?


Security

There is one drawback to using FTP and TELNET, the basic protocol is both widely understood and unencrypted. This means that all network traffic to and from Programmer Studio can be intercepted and reconstructed.

Within a secured network environment (LAN or corporate WAN) this should not prove to be an issue. However, using Programmer Studio to access a server via the Internet should be considered carefully. In such situations, we recommend using a VPN (Virtual Private Network) connection.


Active Server Profiles

Programmer Studio literally hides many of the complexities of communicating with a remote server by establishing and using connections only when necessary. As this may cause a delay when opening a file or viewing a directory, Programmer Studio uses the main status-bar to reflect the current task and its status.

This status may take the format of a message indicating the current stage during authorization of the specified user, the amount of data received for a directory listing, or the time remaining before a file has been completely transferred.

Viewing Active Connections

As Programmer Studio will actively connect and re-connect a server when required, for many users the state of active connections is unimportant. Using the server connections window it is possible to determine which server profiles are currently connected, the duration of the connection, and also the name of the user authorized.

To display the server connections window, from the View menu select Server Connections.

Using the server connections window it is also possible to disconnect from a server. This will terminate the FTP or WTRSH connection used to access files and close the current TELNET session. This may be useful when server profiles have been configured to prompt for the login user, as this provides an easy way to change the current user.


Configuring a Server Profile

The server profiles dialog box is organized in a very simple two-level hierarchy, with each defined server profile appearing as a sibling of a root item. This is intended to visually represent the relationship between the default server settings, and those specified for each individual server profile.

Server profiles cannot be modified if an open file or the current project has been opened using this server profile.

This section discusses the options available for a server profile. This section is organized based on the tab on which the options appear.

Related Topics

  • Default Server Profile

  • General Settings

  • File Access Settings

  • Session Settings

  • Advanced Settings


Default Server Profile

Typically there are a number of settings that a user may wish to specify that apply to all server profiles. The default profile provides this feature whilst still allowing each setting to be customized in a server profile.

Hide Files with Names Started With a Period

This option allows you to hide files beginning with a period character. Typically, configuration files on UNIX platforms are identified in this way.

Resolve Link File Locations

This option determines the actual target for UNIX link files by attempting to change directory using the link name. This may be required if symbolic links are used as short-cuts to other directories.

Verify Files Written

Following a successful save, each file is transferred back to the PC and compared. This option provides an extra level of security when editing important files.

Set ASCII as the Default Transfer Type

This option sets the default transfer type selected in the File Open dialog box to ASCII. This is required when opening files from non UNIX servers, such as VMS and AS/400, when text files must be transferred as ASCII to be correctly formatted with line breaks. This option is not required on the HPe3000 as Programmer Studio uses the MPE build parameters to determine the correct file type.

Disable Initial Directory Listing in the File Dialog Box

This option prevents the initial directory listing being returned when changing servers in the File dialog box. This can be especially useful when the initial directory contains hundreds of files.


General Settings

This section discusses the options displayed on the General tab for a server profile.

Profile Name

This option specifies the name assigned to this server profile. Each server profile name must be unique and cannot contain the ‘/’ character (as this is used as a path delimiter).

Host

This option specifies the host name or IP address of the server.

Default User

This option specifies the name for login authorization. If this is left blank, Programmer Studio will prompt for the user name when required.

Password

This option specifies the password for login authorization.

Prompt for User Name and Password

When enabled, Programmer Studio will prompt for the user name and password to use when connecting to the server. The settings for Default User and Password are used as the default settings for the prompts.

File Access

This option determines which protocol, FTP or WTRSH, should be used to access files on the specified host.

Note

The WTRSH protocol is provided for HPe3000 support only.

Session Type

This option determines if TELNET should be used to create a session on the server when executing commands, compiling or debugging. If this option is left blank, files cannot be compiled.

Character Set

This option determines the character set to use to ‘map’ extended ASCII characters in text files. ISO-Latin-1 is identical to the Windows character set.


File Access Settings

This section discusses the options displayed on the File Access tab for a server profile. The check-box options on this tab can reflect three distinct states, checked – enabled, unchecked – disabled and shaded – use default setting. When displaying the shaded state, the presence of a check mark indicates the default setting that will be used.

Initial Directory

This option determines the directory in which the user will be located when first selecting to navigate files on this server in the file dialog box. Leaving this field blank will start the user in the default login directory defined by the server.

Hide Files with Names Starting with a Period

This option allows you to hide files beginning with a period character. Typically, configuration files on UNIX platforms are identified in this way.

Resolve Link File Locations

This option determines the actual target for UNIX link files by attempting to change directory using the link name. This may be required if symbolic links are used as short-cuts to other directories.

Verify Files Written

Following a successful save, each file is transferred back to the PC and compared. This option provides an extra level of security when editing important files.

Set ASCII as the Default Transfer Type

This option sets the default transfer type selected in the File Open dialog box to ASCII. This is required when opening files from non UNIX servers, such as VMS and AS/400, when text files must be transferred as ASCII to be correctly formatted with line breaks. This option is not required on the HPe3000 as Programmer Studio uses the MPE build parameters to determine the correct file type.

Disable Initial Directory Listing in the File Dialog Box

This option prevents the initial directory listing being returned when changing servers in the File dialog box. This can be especially useful when the initial directory contains hundreds of files.


Session Settings

This section discusses the options displayed on the Session tab for a server profile. If the Session drop-down on the General tab is set to none, these settings have no effect. The session tab uses a table to represent the prompt/response fields used to programmatically create a TELNET session to the server.

Terminal Emulation

This option defines the emulation mode used in the session output window. Terminal emulation describes the specific support of escape sequences to provide enhanced display, formatting and data input capabilities. Selecting “none” will not disable the session settings; it will simply ignore all escape sequences sent.

Wizard

Click this button to launch the session wizard. The session wizard will take you through the complex steps required to define the prompts, responses and the format of an expression to detect the session command prompt.

Login Wait For

This option defines the text to wait for before sending the desired response. This may be specified as a regular expression. When doing so it is recommended you use the start of line indicator “^” at the start of the expression.

Login Response

This option defines the response to the related wait for prompt. The response field supports a number of variables which are interpreted at run-time:-

To represent | Use
Server profile Default User | $(Username)
Server profile Password | $(Password)
Server profile Default User and Password as a single formatted MPE login string | $(MpeLogin)
Tab key press | $(Tab)
Return key press | $(Return)

Login Prompt

Check this option to display a prompt for the correct response. The contents of the response field will be displayed as the default.

Wait For

This option defines the format of the session command prompt after a successful login. The correct detection of the command prompt is essential if any commands are to be executed at all. Unless the server specified uses a fixed session prompt, this must be specified as a regular expression.

Set the Prompt

This option allows a command to be executed on the server following a successful login that will change the format of the command prompt. This can be very useful if the normal session prompt is too simple or cannot be adequately represented using a regular expression.

For example, the following command changes the command prompt on a UNIX platform:

PS1=PSTUDIO4_PROMPT:

This prompt could then be detected with certainty using the following Wait For setting:

^PSTUDIO4_PROMPT:


Advanced Settings

This section discusses the options displayed on the Advanced tab for a server profile. Due to the number of advanced settings, the advanced tab is sub-divided by category. Using the drop-down to select a specific category changes the remaining options displayed on this tab.

If options are not applicable to the server profile, an exclamation icon is displayed at the bottom of the tab and the options remain disabled.

FTP

The PASV mode option ensures that all connections to the server are initiated by Programmer Studio. When not enabled, the file listing and file transfers are made over connections initiated by the server; many firewall or proxy servers will not support this.

Note

Older server platforms may not support PASV mode.

The STOU mode option provides the ability to store a file using a temporary file name which can then be renamed to the proper filename only after a successful transfer. This can be very useful on unreliable links as some FTP servers may delete any existing target file as soon as a file transfer starts, and not when successful.

When enabled, Programmer Studio uses the SITE command to restore the permissions of a UNIX file after it has been saved. If this option is not enabled, or supported by the server, the FTP server will assign default permissions to the file. If you are editing files such as shell scripts or CGI scripts which can be executed, this can result in the file losing the execute permission.

The Port number specifies the TCP/IP port on which the server is accepting connections. The default port number for FTP is 21; however system administrators may change this to help defeat casual hackers.

TELNET

Then XON option specifies that the server transmits the XON character when it is “ready” to accept data.

When enabled, the VT backspace option converts all backspace characters typed into the session output window into delete characters.

The CHDIR option should be used for HPe3000 servers that do not place the user in the POSIX (UNIX compatible) shell following a successful login. Before executing a command, Programmer Studio first changes the current directory by issuing a “cd” command followed by a fully-qualified path. In the native HPe3000 shell, the “cd” command is not supported and “chdir” should be used instead.

The SET DEF option should be used for VMS servers which do not place the user in the POSIX (UNIX compatible) shell following a successful login. This option will use the SET DEF command followed by a VMS format directory specification [000000…] instead of using “cd” to change directories before executing commands.

The Port number specifies the TCP/IP port on which the server is accepting connections. The default port number for TELNET is 23; however system administrators may change this to help defeat casual hackers.

WTRSH

The UDC options specify the level of support for system, account and user UDCs. It is important to remember that this does not affect any commands executed, only to resolve file and COPYLIB locations.

The Port number specifies the TCP/IP port on which the server is accepting connections. The default port number for WTRSH is 11000 although this may have been changed by your system administrator.

HPe3000

Enabling access to the native MPE file system will prevent access to POSIX directories and allow the use of native MPE file names in the format FILE.GROUP.ACCOUNT.

The CALLCI option should be used when the user is placed in the POSIX (UNIX compatible) shell following a successful login. When executing commands which have the format FILE.GROUP.ACCOUNT the command callci is used as a prefix.


File Types and Languages

Programmer Studio provides a fully customizable development environment for many different programming languages. To provide ultimate flexibility, display options (such as color syntax highlighting) are organized into Languages and editing preferences (tab size etc.) are organized into File Types.

One typical question among new users (and those upgrading from earlier versions) is, why are File Type and Languages defined separately? By defining Language settings separately, the same language syntax may be assigned to several File Types, for example COBOL and COBOL85. Also, File Types such as ASP or PHP can use more than one language in the same file.

What do you want to know more about ?

  • Introducing File Types

  • Favorite File Types

  • Configuring File Types


Introducing File Types

Programmer Studio is installed with a number of File Types for popular programming languages. These are intended to providing a starting point for new users who are encouraged to customize and create new File Types as they require.

HPe3000 File Types

In addition to the file types created for popular programming languages, Programmer Studio also provides a large number of ready-to-use file types for HPe3000 files. These include;

• Command files (CI)

• Message Catalog files

• SPL source files

• Transact source files

• Turbo Image Schema files

• Powerhouse files (Quiz, QTP and Quick)

• Robelle Qedit® files

• Robelle Suprtool files

• Vesoft MPEX files

Due to the large number of file types already provided for the most common programming languages, the HPe3000 specific file types are not initially displayed.

To enable HPe3000 file types

  1. From the Tools menu, select Options, then Preferences.

  2. From the category list (displayed on the left), select HPe3000.

  3. Click the Display MPE File Types option.

  4. Click OK

Once enabled, HPe3000 file types are displayed alongside the normal file types.


Favorite File Types

Most users will probably make use of a small number of file types almost exclusively. To make the selection of these file types as simple as possible, Programmer Studio allows each file type to be marked as a favorite.

Once enabled, these favorite file types appear as short-cuts in the new file toolbar drop-down menu.

In addition to the toolbar menu, favorite file types also appear before all other file types when listed in drop-down lists. For example, the Edit As drop-down in the file Open and Save As dialog boxes.

To select a File Type as a favorite

  1. From the Tools menu, select File Types.

  2. From the tree view of file types, click the check mark to the left of the file type name.

  3. Click OK.


Configuring File Types

The file types dialog box is organized in a very simple two-level hierarchy, with each defined file type appearing as a sibling of a root item. The current file types are displayed in a tree structure to the left, with the properties for the currently selected file type displayed in a series of tabs to the right. As the selection in the tree view changes, the contents of the fields in each tab reflect the new selection.

If a File Type has been modified, the word “(custom)” will appear to the right of the File Type name immediately above the tab headings.

What do you want to know more about ?

  • Default File Type

  • General Settings

  • Editor Settings

  • Line Number Settings

  • Auto Text Settings


Default File Type

The default File Type specifies the settings which are applied to all files types. When a file has no specific file type, for example a simple text file, these settings are used to determine how the Code Editor should appear and what editor options are enabled.

The default file type settings also provide the basis for each specific file type, at which point each option may be individually overridden to further customize the editing environment. For example, enabling the Display ruler setting on the default file type will ensure that the ruler is displayed for every file type unless the same setting is then disabled in a particular file type.


General Settings

This section discusses the options displayed on the General tab for a file type. This should not be confused with the General tab for the default file type, which refers to options described in the Editor Settings section below.

Filename(s)

This field determines the expression that is used to match a filename belonging to this file type. The format of the filename may be any DOS/UNIX style filename match, using ‘*’ and ‘?’ as wildcards to match a range of characters. Multiple filename matches may be specified using a semi-colon as a delimiter.

For example, to match any files with the extension TXT:-

*.txt

To match any files with the extensions C, CPP or H:-

*.c;*.cpp;*.h

To match any files which start with the name READ:-

read*.*


Editor Settings

The editor tab provides the options that apply to the general editing process and how the code editor appears to the user. This section also describes the options displayed on the General tab for the default file type.

The check-box options on this tab can reflect three distinct states; checked (enabled), unchecked (disabled), and shaded (use default setting). When displaying the shaded state, the presence of a check mark indicates the current default setting.

Language

This option defines the language syntax for the file. This defines keywords, quoted string support, comment layout and CodeAware support.

Tab Stops

Support for the representation of tab stops or tab characters (ASCII 9) are divided into two categories, default size and fixed positions.

Tab stops are set at the default positions following the last fixed tab position. If no fixed tab positions have been specified, each tab stop is positioned the specified number of characters from the left margin.

For example, to set fixed tab positions every 10 characters for the first three tab stops, in the pos field enter, “10, 20, 30”. To continue with tab stops at 4 character intervals, in the tab stops field enter “4”.

To set tab stops every 8 characters, in the tab stops field enter “8”, and ensure the pos field is left empty.

Line Length

This option is designed for use with files where the length of any line is limited to a fixed size, for example COBOL. When set, the line length is represented visually in the code editor and a warning is given when saving a file that includes a line longer than the specified limit.

Guide Lines

Guide Lines provide a purely visual indication of character positions as vertical lines displayed in the Code Editor. This can be useful when working with files where the layout of multiple lines must be exact, for example fixed format data files.

Guide Lines are specified as a comma delimited list of character positions relative to the left hand margin.

Smart Indent

Smart indent provides a simple method to ensure that tabs and spaces preceding the first character on a line are duplicated for new lines when hitting the return key at the end of a line.

Trim Spaces When Loading

This option allows all space and tab characters appearing at the end of each line to be ignored when loading a file. This can be useful not only to reduce the size of files where trailing spaces are ignored (i.e. C source files), but also when using the END key to quickly position the insertion point at the end of a line.

In the case of COBOL files with line tags or files with line numbers appearing at the end of each line, this feature can be used to remove the spaces inserted for formatting.

Trim Spaces When Saving

This option allows all space and tab characters appearing at the end of each line to be ignored when saving a file. This can be useful to reduce the size of files where trailing spaces are ignored (i.e. C source files).

In the case of COBOL’85 files using line tags, or files with line numbers appearing at the end of each line, this feature is ignored and the required number of spaces are inserted before the line tag or number.

Insert Tabs as Spaces

This option will convert tab characters as they are typed into the correct number of spaces required to reach the next tab stop. This feature may be required for compilers that do not support the use of the tab character in source files.

Note

When pasting text from the clipboard, any tab characters included in the text are NOT converted. It is strongly recommended that the Save Tabs as Spaces option should be used to ensure no tab characters are included when the file is saved.

Save Tabs as Spaces

This option will convert all tab characters into the correct number of spaces required to reach the next tab stop when the file is saved. This feature may be required for compilers that do not support the use of the tab character in source files.

Display Ruler

This option will display the ruler in the Code Editor.

Note

To display the tab stops on the ruler see the Code Editor category in the Preferences dialog box.

Display Line Numbers

This option will display line numbers in the Code Editor. This will either be the line index or, in the case of numbered files, the line number in the file.


Line Number Settings

This section discusses the options displayed on the Line Numbers tab for a file type.

Enable Intelligent Line Number Support

When enabled, detected line numbers are protected from editing. Based on additional options, line numbers will be assigned to new lines intelligently.

Character Position

This field determines the position on each line at which the line number starts. For file types where the line number starts each line, i.e. COBOL, this should be set to 1.

Digits

This field determines the number of digits in the line number.

Start

This field determines the starting line number for new and automatically renumbered files.

Sequence

This field determines the default increment used between line numbers.

Automatically Renumber Files When Saving

This option determines if the existing line numbers in a file should be replaced with an automatically generated line number sequence when saving. This is particularly useful when the user is not interested in keeping existing line numbers, as Programmer Studio will not display an error when new lines may not be inserted in sequence.

Display Line Numbers in MPE Format

This option will display line numbers with a period for a thousands separator and hide any trailing zero’s. This does not affect the format in which line numbers are saved.

Detect COBOL’85 Line Tags

This option will examine character positions 73 to 80 on each line to determine if line tags exist.

Auto-Tag Modified Lines

This option will automatically update character positions 73 to 80 on each line, when a change is made to that line. The format of the inserted line tag is specified in this field. A number of existing line tag formats are provided in the drop-down list.


Auto Text Settings

This section discusses the options displayed on the Auto Text tab for a file type. For more information on Auto Text, please see Chapter 5, Editing Files, Text Completion.

Detect Auto Text Trigger

This field determines the “trigger” text that should be detected when typing in the code editor. The list displays the currently defined triggers. Selecting an item from the list updates the contents of the Detect Auto Text Trigger and Prompt to Replace With fields.

Prompt to Replace With

This field determines the text that can be used to replace the detected “trigger”. The length of the replacement text is not limited by the size of the trigger text.

Add

Click Add to update the Auto Text trigger using the Detect Auto Text Trigger and Prompt to Replace With fields. If the trigger is not displayed in the list, it is added at the end.

Delete

Click Delete to delete the Auto Text trigger highlighted in the Detect Auto Text Trigger list. The previous item in the list is then selected, updating the prompt and trigger fields.

Display Auto Text for Language Keywords

This option displays the Auto Text prompt when the first 3 characters of a language keyword are typed in the code editor.

Note

Auto Text checks for keyword matches before expression triggers.


Editing Files

Programmer Studio provides many of the familiar options for editing text found in most Windows programs, including other development environments and word processors. Existing Windows users should be immediately familiar with the code editor.

The appearance of the cursor represents the current editing mode. A single vertical line cursor indicates that new text will be inserted at the current insertion point. A block cursor indicates that new text will overwrite text following the insertion point.

What do you want to know more about ?

  • File Types

  • CodeAware View

  • Selecting Text

  • Drag-and-Drop Editing

  • Indenting Text

  • Text Completion

  • Visual Elements

  • Formatting Text

  • Files Containing Line Numbers

  • COBOL Tags

  • Embedded Languages

  • Split-screen Editing

  • Hex Editor


File Types

It is essential that you select the correct File Type when editing your files. Each File Type can be customized to specify the programming language, default editing options (such as tab stops and virtual space), and most importantly, file format options.

Once opened, you cannot change the File Type assigned to a document without closing, then reopening the file. To determine which File Type has been selected for an open document, select Properties from the View menu.

Tip

Placing the cursor over the “tab” displaying the document file name will display a tool-tip that includes information on the file, including the File Type.


CodeAware View

For each file opened in the code editor, Programmer Studio’s CodeAware feature provides an enhanced view of the current file in the Syntax tab in the workspace window. Using the language specified in the current document’s file type, Programmer Studio scans the contents of the file providing a tree view detailing the exact structure of the current file.

The tree view identifies all the major elements in a file based on the programming language. For example, in Java this will display those classes defined; for C, all functions, global variables and structure definitions; for COBOL, working-storage and paragraph definitions.

Detailed information on items in the CodeAware view can be obtained by simply placing the mouse pointer over the item and waiting for a tool-tip to appear. To highlight the line in the current document that contains the declaration or definition, simply double click in the tree view.


Selecting Text

Identifying selections are an important part of editing text files. A selection may indicate a range of characters on a single line, a number of lines, or even the entire file contents. To remove an existing selection, click anywhere in the editable area, or press one of the arrow keys.

The Code Editor allows three different types of selections to be created; normal selection, line selection and block selection. This topic introduces the three selection types and indicates how they may be created and used.

Normal Selection

Most Windows users will be familiar with the concept of creating a selection from text. This type of selection can include one or more characters over one or more lines with the range extending from left to right and downwards.

To create a normal selection

  • Place the insertion point at the start of the selection, hold the mouse button down, and drag the insertion point to the end of the selection.

  • Place the insertion point at the start of the selection, hold down the SHIFT key, and click the insertion point to the end of the selection.

  • Place the insertion point at the start of the selection, hold down the SHIFT key, and use the cursor keys to move the insertion point to the end of the selection.

An existing selection may be extended or restricted by moving the insertion point using either the mouse or keyboard while keeping the SHIFT key pressed.

Tip

You can quickly select an entire word by simply double-clicking on the word.

Line Selection

A line selection encompasses the entire content of one or more lines. This can be particularly useful when working in languages that employ line based identifiers, such as line numbers and COBOL line tags.

To create a line selection

  • Click in the selection margin using the mouse, hold the mouse button down, and drag to the end of the selection.

  • From the Edit menu, select Select Line

A thin border is displayed around those line numbers that are considered to be included in the current selection. Although these line numbers will not be included in any clipboard operation, this is useful to determine what lines will be removed when deleting a selection and which lines may be joined together.

Block Selection

Block Selection, (also known as block-mode selection), differs greatly from the other selection types. Using a block selection, text can be highlighted from one 'column' to another 'column' just as cells may be highlighted in a spreadsheet.

This type of selection can be particularly useful when aligning code to improve readability. Once a block selection has been created it can be easily moved left or right or dragged to a new position using the mouse.

To create a block selection

  • Place the insertion point at the start of the selection, hold the mouse button and ALT key down, and drag the insertion point to the end of the selection.


Drag-and-Drop Editing

Drag-and-drop editing is the easiest way to move or copy a limited selection a short distance. However, when moving or copying a large amount of text, Cut, Copy, and Paste, are often more convenient.

To move or copy text using the mouse

  1. Select the text you want to move or copy.

  2. Point to the selected text, and then hold down the left mouse button.

  3. Keeping the mouse button down, drag the insertion point to the new location.

  4. To move the text, release the mouse button

    - or -

    To copy the text, hold down CTRL while releasing the mouse button.


Indenting Text

Programmer Studio provides a number of options for controlling the layout and use of tabs, virtual space and auto-indenting. Although most programming languages use indenting to improve readability, some older languages require indenting at fixed positions. Programmer Studio provides a solution to all these requirements.

What do want to know more about ?

  • Tab Stops

  • Virtual Space

  • Indenting a Selection

  • Smart Indent


Tab Stops

The tab character is commonly used in programming languages to format text to enhance readability. Although a tab is represented in a file as a single byte, almost all text editors allow the user to specify the width of a tab in terms of virtual space. When displayed, each tab character then assumes the correct number of spaces to reach the next tab position.

Programmer Studio allows tab stops to be specified as fixed positions and then by size, extending from the left-hand margin. Where no fixed positions are defined, the tab size is used to determine the positions of all tab stops.

Specifying Your Preferred Tab Stops

Using the File Type options, custom tab stops may be specified for each file type. For files that are not assigned a file type, the default file type settings are used for the tab stops.

Changing Tab Stops

Although File Types allow you to customize the Tab Stops for a specific File Type, there will be situations where you will need to alter the tab stops for a specific file. The code editor allows you to override the tab stops currently specified for a file with a completely different layout.

To customize the tab stops for a file

  1. From the Format menu, Select Tabs

  2. Specify the tab positions and/or the default tab size

  3. Click OK

The Tab Stops dialog box also provides the option to “apply” the new tab tops to the current file, instantly providing a visual representation of the specified settings. Pressing Cancel will restore the original tab settings, even after using “apply”.

Note

Changing the position or size of tabs will only affect the visual representation of the tab character (ASCII 9) and not sequential spaces.


Virtual Space

There are certain situations where files that include tab characters may not be supported or displayed correctly on other platforms. In order to allow the user to continue to make use of the indenting features in the code editor, Programmer Studio provides the option to convert each tab character to a sequence of spaces.

The results are visually identical; however the file now contains a number of spaces where previously a single tab character may have been present.

Inserting Virtual Space as you Type

File Types provide two options for the dynamic conversion of tab characters, Insert Tabs as Spaces automatically converts a tab key press into sequential spaces, Save Tabs as Spaces converts any remaining tab characters when saving. As these options are specified in the File Type settings, they are applied to a file when it is opened and cannot be changed once the file is open. To convert existing tab characters into spaces, use the Untabify feature.

Note

The Insert Tabs as Spaces feature does not convert tab characters copied from the clipboard. To ensure that all spaces are removed, the Save Tabs as Spaces option should be enabled.

Untabify

The Untabify feature converts each tab character in the current document or selection into the correct number of spaces required to reach the next tab position. By default, the Untabify feature will use the currently defined tab settings, although theses may be overridden.

If the tab size and positions are not changed from those used in the current file, there will be no visual change in the display of the file contents.

Tabify

The Tabify feature converts sequences of spaces into single tab characters based on a specified tab size. The Tabify feature scans the current document or selection to determine the most common size of a tab stop currently represented by spaces.


Indenting a Selection

A popular requirement when editing source code is to alter the indent level of existing text. This may in response to inserting conditional or recursive statements or to ensure that variable declarations remain aligned to ensure readability.

Programmer Studio provides 4 options for changing the indent level of the currently selected text. Typically the indent features are applied to normal or line selections; however, by creating a block selection, you can indent a range of columns.

Increase Indent

This option will indent the first non-space (including tabs) character to the next tab position to the right for each line in the selection. This will typically involve inserting a tab character, however if the current file’s file type specifies that tabs must be inserted as spaces, the correct number of consecutive space characters will be inserted to reach the next tab stop.

Decrease Indent

This option will position the first non-space (including tabs) character to the next tab position to the left for each line in the selection. This will remove either a single tab character or multiple spaces.

Increase Indent by 1

This option will move the first non-space (including tabs) character to the right by one character position for each line in the selection.

Decrease Indent by 1

This option will move the first non-space (including tabs) character to the left by one character position for each line in the selection. Tab characters will be converted to consecutive space characters as required.

Drag and Drop

You can easily specify a new indent position of a block selection using drag-and-drop. As you drag-and-drop the current selection, the cursor position is moved to represent the insertion point. Releasing the mouse button will then indent the selection to start at the specified position.

Note

The drag-and-drop insertion point targeted must be on the same line as the first line in the block selection to perform an indent. Otherwise the selection will be moved to start from the insertion point.


Smart Indent

Smart indent provides a simple method to ensure that the format of text indented from the left-hand margin is maintained as new lines are inserted. This is achieved by copying all the tab and space characters preceding the first non-space character on a line to the beginning of each new line.

This feature is especially useful when programming in languages where the level of an indented line visually indicates association with a previous expression. For example, typing a return at the end of the following line:

{tab}{tab}some text

Will insert a new line starting with the tab stops, positioning the insertion point immediately after the two tab characters, for example:

{tab}{tab}

Smart indent will duplicate the order in which tabs and spaces appear.


Text Completion

Programmer Studio includes many features designed to make the user immediately more productive regardless of what language they are using. By providing prompts, tips and drop-down lists, Programming Studio can effectively reduce the time spent entering code.

What do want to know more about ?

  • Auto Text

  • Code Aware


Auto Text

Auto Text is designed to prompt the user when typing repetitive keywords or expressions and allow the desired text to be inserted as quickly as possible.

Auto Text support is enabled thru the File Type settings. For more information please see the chapter titled “File Types and Languages”.

Keywords

Auto Text support is divided into two categories, keywords and expressions. Keyword support simply watches what the user types and after a number of sequential characters makes a suggestion based on the keywords defined for the current language.

In this example, while editing a C source file, the user types “#in”. Auto Text uses the built-in list of keywords for the language (used for keyword coloring) and prompts the user to press the return key to complete the keyword.

Expressions

Auto Text for expressions provides the same functionality with the exception that the “trigger” and suggested text can be defined by the user.

In this example, an expression has been created using the trigger, “.p”, which will prompt to be replaced with the text “Programmer Studio”.

Note

Auto Text checks for keyword matches before expression triggers.


Code Aware

Programmer Studio can greatly increase your productivity using the Code Aware database for a particular file. Unlike the Auto Text options, Auto Complete and Auto List Members are not enabled while you type and must be activated using the Edit menu or using the hot-key combination.

Auto Complete

The Auto Complete feature uses the text at the current cursor position and attempts to match this against the recognized syntax elements defined in the current file. A drop-down list appears highlighting the most likely match for the partial keyword.

Pressing return inserts the currently selected list item, replacing the partial word typed. Using the cursor keys, the selection in the list may be changed. If you choose to continue typing, the selection in the list box will continually search the list to highlight the word that most closely matches.

Auto Complete can be activated by either pressing CTRL+SPACE or be selecting Auto Complete from the Edit menu.

Auto List Members

The Auto List Members feature is designed for use in programming languages such as C/C++ and Java. When the “member of” delimiter is typed (which can be either “->” or “.”), Programmer Studio attempts to determine the type of the variable preceding the “member of” delimiter. If the variable is recognized, a drop-down list appears containing the fields defined for the variable’s type.

As with Auto Complete, the selection in the list will be updated as you type, selecting the list item which most closely matches the text following the delimiter. The Auto List Members feature can also be accessed using the Edit menu.

Parameter Info

Unlike the other Code Aware options, the Parameter Info feature is purely informative. When activated, the Parameter Info feature displays the parameters defined for the current function/procedure as a tool-tip. The current function/procedure is identified as the keyword at the current cursor position, or the keyword appearing before the next open bracket character to the left of the cursor.

The Parameter Info tool-tip displays the current argument in the function/parameter list in bold for easy identification. The current argument is determined by counting the number of commas to the left of the cursor, before the open bracket.


Visual Elements

Programmer Studio provides a number of intelligent user-interface elements to further increase programmer productivity, from the text ruler to highlighting matching bracket pairs.

Most of the visual elements introduced in this section may be toggled between visible and hidden using their respective items in the View menu. When visible, the menu item will appear with a check mark to the left of the menu text.

Note

Selecting to view or hide a visual element only affects the current document and not all open documents.

What do you want to know more about ?

  • Text Ruler

  • Line Numbers

  • Selection Margin

  • Cursor Highlight

  • Bracket Highlighting

  • Selection Tips

  • Guide Lines


Text Ruler

The text ruler provides a visual indication of the position of characters relative to the first character of each line. It is important to remember that the toolbar presents only an indication of character position; it does not reflect tab stops. Optionally, the tab stops defined for the current document may also be displayed on the text ruler. This option is provided in the Preferences dialog box, in the Code Editor category.


Line Numbers

The line numbers are displayed to the left of the editable area of the code editor. Normally the line numbers displayed indicate each line’s position in the file starting with line 1.

Files Containing Line Numbers

If the current document’s File Type specifies that line numbers should be protected, the protected line numbers are displayed instead of the line index.

For each line that does not contain the correct number of digits as defined by the File Type, or is too short (i.e. blank line), the code editor displays a red colored arrow (greater than) symbol after the line number.

Note

HPe3000 can optionally display line numbers in MPE format. This feature is discussed in the chapter “File Types and Languages”.


Selection Margin

The selection margin is displayed to the left of the editable area in the Code Editor providing an easy way to highlight complete lines and view the modified state of each line. Unlike the other options described in this section, the visible state of the Selection Margin is a Programmer Studio option and cannot be specified on a file or file type basis.

The selection margin can be used to highlight a complete line of text by simply clicking in the margin using the left mouse button. To select multiple lines, click in the selection margin and drag the mouse pointer up or down while keeping the left mouse button pressed down. Release the left mouse button to finish the selection.

The selection margin can also display the modified state of each line in the current document using an icon to represent when an existing line has been modified or a new line inserted.

Margin Marker | Indicates
 | An existing line has been modified
 | A new line has been added

To view the selection margin settings

  1. From the Tools menu, select Options, then Preferences

  2. In the category list, select Code Editor


Cursor Highlight

The Cursor Highlight provides a solution to the problem of determining on which line the cursor is located. By changing the background color of the code editor for the current line, the user is immediately aware where the insertion point is located.

This option is very useful when using a very large display or when the flashing cursor may become easily lost in the surrounding text.

We recommend setting the color of the line for the cursor highlight to a slight hue on the chosen background color. This will allow the cursor highlight to be easily identified while ensuring the other syntax coloring items remain easily visible.


Bracket Highlighting

Bracket highlighting is especially useful for programming languages that use either brackets ‘(’ and ‘)’ or curly braces ‘{’ and ‘}’ to organize code blocks and expressions. Often typing compound expressions and code blocks can leave the programmer in doubt as to which end bracket or brace corresponds with which starting bracket or brace. Consider the following sample text:

if ((a = 1) and (((b = a) or (b > 1)) and (c = 2))

Bracket highlighting allows the programmer to quickly determine if the expression is complete, by highlighting the corresponding open bracket for each close bracket highlighted. For example, placing the cursor above the last bracket in the example expression:

Or when typing a closing bracket at the end of the example expression:

This allows the programmer the luxury of a visual indication that an expression that uses enclosing brackets is complete.


Selection Tips

For those situations when it is important to determine the range of characters in the current selection, selected range tool-tips can be displayed. The range tool-tips display the actual character position of the first, last and number of inclusive characters in the current selection.

For selections including more than one line, the number of lines selected is displayed instead.

Note

Tab characters included in a selection are only counted as a single character.


Guide Lines

Guide Lines provide a visual indication of fixed positions on a line by displaying a vertical line before the specified character positions on each line. This can be particularly useful when working on data files that use fixed positions from the start of a line to represent record locations.

Just as with tab stops, guide lines are specified as comma delimited character positions relative to the left margin. Using the Guide Lines dialog box, you can click the Apply button to provide an instant visual representation of the guide lines defined.

Note

Guide lines can be defined for a specific File Type.


Formatting Text

Programmer Studio provides an assortment of formatting capabilities within the code editor including sorting, changing case and inserting text. The following sections describe how each of these features can be used to further enhance programmer productivity.

What do you want to know more about ?

  • Change Case

  • Change Columns

  • Comment and Uncomment

  • Trim Selection

  • Sort


Change Case

A popular requirement among programmers is the need to change the case of text without re-typing. The Change Case dialog box provides 5 different options for changing the case of the currently selected text.

To | Select
Capitalize the first character of each sentence, converting the remaining characters to lowercase. | Sentence Case
Convert all characters to lowercase. | Lowercase
Convert all characters to uppercase. | Uppercase
Capitalize the first character of each word, converting the remaining characters to lowercase. | Title Case
Reverse the case of the selected characters. | Toggle Case

Note

When using Sentence Case, if the selection does not include a period, the first character in the selection is capitalized.

To change the case of text in the Code Editor

  1. Select the text you wish to change the case of

  2. From the Format menu, select Change Case

  3. Select the case style to use

  4. Click OK


Change Columns

Change Columns provides the functionality to insert into or delete from a selection on a column-by-column basis. Using change columns, inserting characters at a specified position, or deleting a range of columns from a fixed format file, can be achieved very quickly.

Change columns are especially useful when working with programming languages that enforce very strict rules on the formatting of source code. In COBOL for example, change columns can be used to quickly modify column 7 (indicator field) to insert a special character for comments or debugging.

To change columns in each line

  1. If you want to change a subset of lines, first select these lines.

  2. From the Format menu, select Change Columns

  3. Click Selection or Whole file to determine the range of line effected

  4. In the Starting at field, enter the starting column

  5. In the Range field, enter the number of columns to be changed. To insert text, enter 0.

  6. In the Insert text field, specify the contents of the columns being changed. To delete the range of columns, leave this field empty.

  7. Click OK

Tip

The Starting at field uses the current cursor position as the initial value.

If a line within the specified range is shorter than the starting column, the line will be padded with the spaces up to the specified column. Specifying no replacement text for a range of columns will shift the text in each line to the left.

To clear the contents of the columns specified, enter the correct number of spaces in the Insert text field. Using change columns, a longer line of text than the size of the range of columns being changed can be specified, so care must be taken when making sweeping changes to a file.


Comment and Uncomment

The comment and uncomment features provide the facility to convert the current selection to and from a language comment. Programmer Studio uses the comment styles defined in the language assigned to the current document’s file type.

To convert the current selection into a comment

  1. Select the text which you wish to comment

  2. From the Format menu, select Comment

Commenting a block of text involves adding the comment identifiers into the selected text. If the Code Editor Template defines both single and multi-line comments, the user is prompted to choose which style should be used.

A space is inserted after each single-line comment to ensure that an unrecognized keyword is not created from concatenated words. For example, inserting the keyword COMMENT at the start of the line BEGIN PROGRAM would create an unknown keyword COMMENTBEGIN unless an additional space was inserted after COMMENT.

Uncomment will delete either multi-line or single-line comments from the currently selected string based on the first comment type encountered from the beginning of the selection. If a space is encountered immediately after the comment keyword this will also be deleted. Please see the paragraph above for more information.


Trim Selection

The Trim Selection feature removes all tab or space characters from the end of each line in the current document or selection. This can be very useful if the END key is commonly used in order to position the cursor after the last character in the line.


Sort

The Sort feature provides options to sort the lines in the current document or selection.


Files Containing Line Numbers

For those programming languages that include a number on each line, Programmer Studio provides increased productivity. When loading a file without an associated File Type, Programmer Studio checks the contents of the first 20 lines of the file. If a series of digits appear at a fixed position on each line of the file, the user is prompted to remove the line numbers while editing.

The File Types settings provide far greater control over this feature, by not only providing an option to check for line numbers, but also providing two options to control numbering while you type. For more information on File Types, please refer to the chapter titled “File Types and Languages”.

Line Numbering

As a file is edited it is inevitable that new lines will need to be inserted. If the line numbers in the file have been protected from editing, you must decide how new line numbers should be assigned.

Intelligent Numbering

Intelligent numbering is the default setting. This option saves the numbers assigned to each line as the file is loaded. When a new line is inserted, the code editor will assign a number to the new line as long as there is sufficient space in the existing sequence of numbers. When no more lines can be added, the user is prompted to renumber the current section, or the entire file, to allow new lines to be inserted.

Automatic Numbering

Automatic renumbering examines the first few lines of a file when it is opened. The line numbers appearing on these lines are then used to determine the starting line number and the sequence for the remaining lines. When the file is saved, the existing line numbers are replaced with the automatic line number sequence.

Clearing the Show Line Numbers option in the File Type, it is also possible to remove any indication that a file has line numbers, perfect for programmers new to line numbers and those wanting to forget the limitations line numbers impose.

Renumbering Lines

You can quickly renumber the lines for the entire document or selection by simply selecting Renumber Lines from the Edit menu. Programmer Studio will suggest a valid numbering sequence for the specified range of lines.


COBOL Tags

The COBOL’85 language specification includes support for a tag field at character positions 73-80 (8 characters) on each line. The tag field is free format text and is commonly used to store modification dates, programmer initials, version numbers, etc.

Each File Type provides an option to remove these ‘tags’ while editing, and like intelligent line renumbering, to restore them when saving. The default file type “COBOL85 source file” is already setup to handle tags.

Updating Tags

Once the tags have been removed from the editable file content, they can be changed automatically as a line is modified or using the Set Line Tag option in the format menu.

Programmer Studio provides two alternatives for defining the tag used in COBOL files, either as a standard tag string applied to all files, or, using an advanced property found in project settings, for individual files.


Embedded Languages

With the continuing development of the internet, the requirement for interactive web content has resulted in the increasing use of embedded programming languages within HTML pages. Using the Contents As item from the View menu, you can quickly switch between the different language components of single file.

One of the major complications when working with a mixed language source file is identifying the scope of each component language. The code editor solves this problem by displaying all content not relating to the current language using a different color, the default settings use a shade of grey to imply the text is “disabled”.

The file types, “HTML file”, “ASP source file” and “PHP source file” are all pre-configured with support for their embedded languages.


Split-screen Editing

Using the “handle” displayed immediately above the vertical scroll bar, you can split the current document into two separate views of the same file. Simply click on the “handle” with the left mouse button and drag the mouse downwards to determine the size of the resulting view.

Programmer Studio allows the document window to be “split” up to 8 times. To remove a split pane, simply click and drag the separator bar back to the top of the window.

Note

The document window may only be split vertically.


Hex Editor

For PC file or files transferred in binary format using FTP, Programmer Studio also provides a fully featured hex editor. The hex editor is ideal for editing binary files as the contents of a file is displayed in both HEX and ASCII at the same time.

The hex editor display is very different from that of the code editor. The content of the open document is dynamically displayed in both HEX and ASCII formats, as two distinct columns each displaying 16 bytes from the file on each line.

The offset of each line from the start of the file is displayed on the left. The hex value of each byte is displayed using two hex digits to represent ASCII values from 0 to 255 (00 to FF) respectively. To enable the position of each hex digit pair, an additional gap is used to separate the first 8 bytes from the second 8 bytes. To the very right, the ASCII representation of the 16 byes is then displayed.

To open a file in the hex editor

  1. From the File menu, select Open

  2. Use the file dialog box to select the file name

  3. From the Edit as drop-down, select Hex

  4. Click Open.

Input Modes

For the two views of the file, hex and ASCII, the hex editor provides two input modes. After loading the file, the cursor is located in the ASCII section of the code editor. To switch between the ASCII and hex views in the file, press the Tab key.

You can edit the ASCII view of the file in exactly the same way as you use the code editor or any other Windows editor.

When editing the hex view of the file, new byte values are entered in pairs of hex characters 0-9 and A-F. The first character represents the upper 4 bits of the value; the second character represents the lower 4 bits of the value.

Tip

You can press the cursor key instead of entering the second hex character to use the value 0.

Selecting Text

The hex editor supports the same ways of selecting text as the code editor, but with one difference. The current selection is displayed in both the hex and ASCII views.

Viewing Modifications

The hex editor uses content coloring to reflect the type of changes that have been made to the current file. Using two alternative colors, the hex editor displays the bytes that have been inserted or overwritten.


Find, Replace and Navigate

Programmer Studio provides a vast array of options for searching, replacing and navigating files regardless of their format; source code, text or binary files.

What do you want to know more about ?

  • Finding Text

  • Replacing Text

  • Finding Text in Multiple Files

  • Bookmarks

  • Moving the Cursor to a Fixed Position

  • Open File from Selection


Finding Text

Both the Code and Hex editors support full string searching. Using the Find dialog box you can search for literal text strings, use regular expressions to find varying words or characters, and even search for binary data using hex ASCII codes.

To find a text string

  1. Move the cursor to the point where you want to begin your search.

  2. From the Edit menu, select Find

  3. In the Find What box, enter the search text or regular expression

  4. Select the appropriate search options

  5. Click Find Next, Find All or Mark All

When the selected text has been found, you have the following options; click Find Next to highlight the next occurrence of the find text, click Find All to list every occurrence of the find text in the Find output window, or click Mark All to add a bookmark to each line that contains the find text.

To cancel the search and return the input focus to the code editor, press Cancel. You can continue to find text matching the criteria and options specified even after closing the Find dialog. Using Find Next (F3) and Find Previous (Shift+F3), you can continue a previous find although the direction is specified by the command selected; Next, downwards, or Previous, upwards.

Tip

The find and replace dialog boxes use the currently selected text in the code editor as the initial criteria in the Find what box. If there is no selection, the word at the current insertion point is used. Clicking the down arrow to the right of the Find what box displays the previous criteria used.

Search Options

By default, Programmer Studio searches the entire file in the code editor for text matching the criteria specified. The search options can be used to alter how text is matched.

Match Whole Word Only

Find whole words and not sub-strings inside words. For example, help and not helping.

When editing source code, the keyword definition in the language settings is used to determine which characters are word characters. For example, the C language definition includes underscore and pound characters in addition to A-Z and 0-9.

Match Case

Find words matching the case of the text in the Find what box. For example help and not HELP.

Regular Expression

Find text matching a specified pattern that varies between occurrences. For example, f.r will match any three letter text string beginning with an f and ending in an r. For more information see Using Regular Expressions.

Clicking the arrow button to the right of the Find What field displays a popup menu of regular expression arguments. Selecting an item from this menu will automatically add the correct arguments to the current search criteria.

Note

If the Regular Expression search option is selected, the Match Whole Word Only option is ignored..

Hex Expression

When specified, the search criteria can be expressed as in hex format. Each hex character must be specified as \x followed by the hex value of the ASCII character to search for. For example, \x20\x41 will match each occurrence of a space followed by the letter A.

For more information on ASCII character values, see Appendix B, ASCII Character Set.

Wrap Search Direction

Continue the search after reaching the start or end of the file (depending upon the initial search direction) to search the entire file.


Replacing Text

The replace dialog box is similar in many ways to the find dialog, providing all the same options for finding text, with the addition of a field to determine the text to replace any matching results.

To replace a text string

  1. Move the cursor to the point where you want to begin your search.

  2. From the Edit menu, select Replace

  3. In the Find What box, enter the search text or regular expression

  4. In the Replace With box, enter the replacement text

  5. Select the appropriate search options

  6. Click Find Next, Replace or Replace All

The replace dialog box provides the additional option to replace the text specified within the confines of the current selection. This option is only available if a selection has been created in the editor.

To undo the effects of the last replacement, select Undo from the Edit menu. This will reverse the last change made. If you confirmed each replacement individually, you will need to undo each change separately.


Finding Text in Multiple Files

With larger programs consisting of a number of relatively small files, searching for text can be a real problem. Opening each file in turn to search for the specific string can be time consuming and never 100% accurate.

Find in Files provides the ideal solution to this problem, by providing the capability to search for text in a subset of files. The search is quickly completed, returning a list of matching files into the output window, allowing the user to examine each occurrence in turn.

To find a specific text string in multiple files

  1. From the Edit menu, select Find In Files

  2. In the Find What box, enter the text string to search for

  3. In the In File Types box, enter the wildcard expression to match file names

  4. In the In Directory box, enter the location (including the server profile name) of the files

  5. Select the appropriate search options

  6. Click Find

Tip

To specify a number of different wildcard expressions for the file type, use a semi-colon as a delimiter.

The results of the search are displayed in the Find in Files output tab in real-time. The search can be cancelled at any time by selecting Stop from the View menu.

You can view each matching occurrence of the found text by double-clicking on the line in the Find in Files output window or by selecting Go To from the Edit menu.


Bookmarks

Bookmarks provide the ideal way to mark specific lines in a file when moving around, providing the ability to jump to the next or previous bookmark, or cycle through the bookmarks.

Bookmarks have a toggle state. This means they can be added and removed in exactly the same way. For example, if a line has an existing bookmark, toggling the bookmark will remove it; if not, one will be added.

The following commands are available using the Edit, Bookmarks menu:

To | Select
Toggle (add or remove) a bookmark. | Toggle Bookmark (CTRL+F2)
Move to the next bookmark. | Next Bookmark (F2)
Move to the previous bookmark. | Previous Bookmark (SHIFT+F2)
Clear all bookmarks in the file. | Clear All Bookmarks (CTRL+SHIFT+F2)

Note

The direction in which the insertion point is moved when selecting the next or previous bookmark is reversed when reaching the beginning or end of the file.

In addition to manually setting bookmarks, Programmer Studio allows bookmarks to be set on the results of a find. This can be particularly useful when determining what to include in partial find and replace operations. Please refer to finding text in the previous section for more information.


Moving the Cursor to a Fixed Position

An alternative to using bookmarks or scrolling the editable area to find a line is to use the Go To feature. Go To provides a number of options for jumping to a particular line in the file. This line can be identified by index or physical line number, bookmark or modification state.

To move the cursor to a line, from the View menu, select Go To then Line or alternatively press CTRL+G.

The Go To dialog box provides a number of options for identifying the line on which to position the cursor. When editing a COBOL or other numbered file, the default setting is to locate a line by the number appearing on that line and not the line index (relative position from the beginning of the file)

Depending upon the selection in the Go To What list, the remaining controls will reflect the options available. Clicking Go To will place the insertion point on the desired line, highlight the line, and move the editable area to ensure the line is visible.


Open File from Selection

It is not uncommon to find that the files loaded into the Code Editor include references to other files, either in the form of comments, quoted strings, or compiler specific inclusion statements.

Programmer Studio makes it possible to quickly open these files simply by creating a selection and clicking the right mouse button.

To open a file from text string

  1. Create a selection that includes all the available components of the file name.

  2. Right-click inside the selection

  3. From the context menu, select Open File…

Programmer Studio uses the current file’s location, the login directory, and any server specific dependencies to create a fully qualified file name. If a fully qualified file name can be determined, Programmer Studio will then attempt to open the file.

Note Programmer Studio will use the same case used in the Code Editor to identify the file name.

COBOL COPYLIB Modules

Programmer Studio provides an additional functionality when connecting to an HPe3000 via the WTRSH protocol. Before checking the current file’s directory for a matching file name, Programmer Studio first checks for a KSAM file named COPYLIB. If detected, this COPYLIB is first searched to determine if it contains a module with a matching name.

Note

The location and name of the COPYLIB searched can be specified in the advanced properties for a project file or folder.


Developing Projects

The concept of project based program development is central to Programmer Studio's visual development environment. Each project determines how to connect to the remote server, the files, and commands to compile the program.

What do you want to know more about ?

  • Understanding Projects

  • Structuring Your Project

  • Project Settings

  • Compile and Build Commands

  • Using the ClassView


Understanding Projects

Projects are more than simply a collection of filenames. The project also stores associated file information, read-only attributes and editing preferences in addition to the commands you will use to compile and, possibly build, these files.

Project Folders

Project folders allow the files included in a project to be organized into a hierarchy. This hierarchy can have an unlimited number of levels allowing the user to determine exactly how a project should be organized.

The structure of a project can be easily adapted to illustrate an existing file system structure or simply to logically organize files. When used together, these two organizational approaches provide the most powerful way to structure your project.

The Project Window

The hierarchy of the current project is presented in the project window as a collapsible tree view. This view can be expanded easily to view all the files in a project, or left partially collapsed to identify a specific group of files.


Structuring Your Project

A well organized project is the key to productive development using Programmer Studio. Effective use of project folders and the ability to use inheritance to share similar settings for a number of different files will save many hours of development time.

What do you want to know more about ?

  • Project Hierarchy

  • Relative vs. Absolute File Locations

  • Using Project Folders


Project Hierarchy

A Programmer Studio project consists of a collection of folders and files that exist in a simple hierarchy. A key advantage of a hierarchical project model is the ability to set properties for a folder which will then be inherited by the folders and files which appear as descendants in the hierarchy.

Although this inheritance model requires some careful planning, the resulting project should require little modification when adding subsequent files and folders. The following example illustrates how a File Type may be specified at a project level, inherited by the files and folders in the project, and then overridden at either level.

 | File Type | Opens With
Project | C source file |
main.c |  | C source file
server |  |
listen.c |  | C source file
client | ASP source file |
login.asp |  | ASP source file
others |  |
makefile | Makefile | Makefile

See Also

  • Relative vs. Absolute File Locations

  • Using Project Folders


Relative vs. Absolute File Locations

Programmer Studio can identify files using either relative or absolute file names. An absolute filename takes the format of a fully qualified location, starting with a ‘/’ to indicate a location from the root directory. Relative file names do not have a fully qualified location. Instead Programmer Studio uses the location property of project folders appearing above the file in the project hierarchy to determine an absolute location.

Take for example, a project containing these two files:

• /usr/dev/a

• /usr/dev/b

These files can be identified in a simple project in one of two ways, either as their absolute file name or relative to the project’s directory. The two examples are illustrated below:

 | Location | Resolves To
Project |  |
a | /usr/dev/a | /usr/dev/a
b | /usr/dev/b | /usr/dev/b

 | Location | Resolves To
Project | /usr/dev |
a | a | /usr/dev/a
b | b | /usr/dev/b

From this simple example, the advantages of using relative file names and directories are obvious. Not simply in reducing project maintenance, but also providing an easy way to point the project at an alternative set of files in a different location as below.

 | Location | Resolves To
Project | /usr/copy |
a | a | /usr/copy/a
b | b | /usr/copy/b

When adding files to the project or a project folder, Programmer Studio will attempt to resolve the location of the files added so that they are relative to the folder to which they are added.

See Also

  • Project Hierarchy

  • Using Project Folders


Using Project Folders

To best illustrate the benefits of structuring a project we will start with a simple example; a project that contains 3 files and no project folders. In this example, the project was created with the Directory property of the project set to /dev, into which the following files were added:-

• /dev/a

• /dev/src/b

• /include/c

When adding files to a project, whether to the root or project folder, Programmer Studio attempts to store the files as relative whenever possible. In this example files added to the project which include /dev (project Directory) as the start of their location have this removed.

 | Location | Resolves To
Project | /dev |
a | a | /dev/a
b | src/b | /dev/src/b
c | /include/c | /include/c

By storing the names of the project files as relative, Programmer Studio allows the user to change the location of the files. As long as the structure is moved intact, the project will only require the Directory property of the project to be changed.

Note

The Resolved Location field in the project settings dialog displays how Programmer Studio will interpret relative file and directory names.

In order to reflect the structure of the existing file system, a new folder source is added to the project. The Directory property of the new folder is set to src and the file /dev/src/b is then moved into the new folder as b. Using the name resolution rules, the location of b is now determined by traversing the tree and building a path, for example:

 | Location | Resolves To
Project | /dev |
src | src |
b | b | /dev/src/b

These examples are intentionally simple and do not show the server profile which would be included in any real path name to a file. However the examples do illustrate how settings are inherited within the hierarchy of a project.

See Also

  • Project Hierarchy

  • Relative vs. Absolute File Locations


Project Settings

The Project Settings dialog provides access to the individual properties of the project, files, and folders in your project. Within the project settings you can set properties on each item or as a group. To view the settings for a project, from the Project menu, select Settings.

The settings dialog is divided into two parts. A structured view of your project appears on the left and the properties for the selected item on the right. Depending upon the selection, the tabs to the right will change.

Tip

To quickly view the specific settings for a project file or folder, right click on the item in the project workspace tree view and select Properties from the popup menu.

A project can consist of three types of components; the project itself, project folders, and files. Each component has its own selection of properties and in some cases these are shared between items of different types.


Compile and Build Commands

Programmer Studio provides a two-step model for compiling project files into the finished program; compiling individual files and then building a program file from the compiled files.

This model is provided purely as a guide for developers. It can be readily applied to programming languages that compile, and then link a number of individual source files into a single executable program file, like C and C++. For other languages however, this can be easily ignored.

Compile and build commands are specified as project properties. Each file in a project can have its own compile command and each project folder (including the project root) its own build command.

What do you want to know more about ?

  • Compiling a File

  • Command Variables

  • Folder Compile Commands

  • Build Commands

  • Compiler Settings


Compiling a File

Before a file can be compiled, the project settings for the file need to specify the command to be executed on the server in order to perform a compile. Programmer Studio imposes no restriction on what commands are executed, as it is the responsibility of the developer to ensure the command is valid and can run without further user intervention.

To set the compile command for a project file

  1. From the project workspace tree view, select the file

  2. From the Project menu, select Settings

  3. In the project settings dialog box, select the Compile tab

  4. Click the Customize compile command box

  5. In the Customize compile command field, enter the command(s) that are to be executed to compile this file.

  6. Click OK

Note

All commands are executed with the file’s location as the current working directory.

Once a compile command has been assigned to a project file there are two ways to compile the file; either by right-clicking on the file in the project workspace tree view or, if the file is the current active document, choosing compile from the Build menu.

By default, Programmer Studio will automatically save all the files that have been changed before compiling. This is done to ensure any errors or warnings generated by the compiler can be correctly identified in the Code Editor.

See Also

  • Command Variables

  • Folder Compile Commands

  • Build Commands

  • Compiler Settings


Command Variables

To prevent typing mistakes and save time entering repetitive compile commands, variables can be used in the command text that is evaluated prior to execution. These variables can be used to identify the name of a file, the fully qualified filename, file extension, etc.

The following table lists the available compile command variables and provides a sample of the output for the file //hpux/usr/dev/sample.java.

For | Enter | Sample
Fully qualified file name | <p> | /usr/dev/sample.java
File name | <f> | sample.java
File directory | <d> | /usr/dev
File extension | <e> | java
File base name | <b> | sample
Project name | <pn> | /usr/dev/b

In addition to the standard compile command variables, HPe3000 compatible file names and locations are also supported. The following table lists the additional compile command variables and provides a sample for the file SAMPLE.PUB.SYS (/SYS/PUB/SAMPLE).

For | Enter | Sample
Fully qualified file name | <mp> | SAMPLE.PUB.SYS
Account and group name | <md> | PUB.SYS

Clicking the arrow to the right of the compile command box in the project settings dialog displays a popup menu containing command variables to choose from.

The field below the compile command field displays an example of the compile command with each command variable evaluated using the current file name and location.

See Also

  • Compiling a File

  • Folder Compile Commands

  • Build Commands

  • Compiler Settings


Folder Compile Commands

Even using compile command variables, entering a compile command for every file in a large project is not only likely to be very time consuming, but will probably introduce problems. To simplify this process, each project folder also has compile command properties which are then inherited for use on all subordinate files without specific compile commands.

At this stage, new users may find it useful to review the Project Structure section earlier in this chapter, as the same considerations for project structure and identifying file locations can be used with folder compile commands.

See Also

  • Compiling a File

  • Command Variables

  • Build Commands

  • Compiler Settings


Build Commands

Build Commands exist at the project folder level (and project root), to provide commands that are used in conjunction with compile commands, for those developers needing to implement a two-stage process to create a program file.

Build Commands offer the option to initiate a compile of all the files contained in the folder that can then be followed by the build command.

See Also

  • Compiling a File

  • Command Variables

  • Folder Compile Commands

  • Compiler Settings


Compiler Settings

Programmer Studio is installed with support for a number of popular language compilers and interpreters, including GNU C, Java and PERL. For each compiler, you can specify the commands to be executed, and more importantly, the format of messages appearing in the command output indicating warnings or errors.

Using these pre-defined compiler settings you can modify the format of a specific compile command while still ensuring that any errors generated are still highlighted correctly.

What do you want to know more about ?

  • Compiling a File

  • Command Variables

  • Folder Compile Commands

  • Build Commands


Using the ClassView

The project ClassView provides an enhanced version of the familiar syntax view displayed for recognized programming language types. Unlike the syntax view however, the project ClassView lists the recognized functions, procedures and class definitions for all files in the current project.

This powerful navigation aid allows you to quickly edit a function or procedure by simply double-clicking on the entry in the ClassView tree, opening the required file and highlighting the definition.

ClassView Database

The ClassView database is initially empty and is only updated when a project file is opened. As you begin to edit more of the files in your project, the database will grow. Using the project settings, you can determine which file types should be included or excluded from the ClassView database.

To enable ClassView support

  1. From the Project menu, select Settings

  2. In the project settings dialog box, ensure the project name is selected in the tree view.

  3. Click the ClassView tab

  4. Determine the file types to be included or excluded

  5. Click OK

Enabling ClassView support for projects containing a very large number of files is not recommended. The overhead in maintaining and continually updating the ClassView database may lead to performance issues.

The ClassView database is saved between sessions using the same name as the project file but with the extension PSO. To improve performance, the database file is only updated when the project is closed and not when the project file is saved.


Compiling Your Files

Programmer Studio provides no specific compiler support for software developers. Instead it offers access to existing compilers by providing the facility to execute a series of commands either on the PC or on a remote server.

Once executed, Programmer Studio traps the output from these commands, displaying the results in the output window in real-time. You can cancel the command at any time by selecting Cancel from the Build menu.

What do you want to know more about ?

  • Compiler Definitions

  • Compiling an Open File

  • Compiling a Project File

  • Highlighting Errors

  • Examining Resulting Errors


Compiler Definitions

Programmer Studio organizes all the information required to use a remote compiler into what is called a compiler definition. This includes the compiler command line and format of compiler errors.


Compiling an Open File

If the current file is not included in the current project, Programmer Studio will prompt you to select the compiler to use when compiling a file.

To compile the current file

  1. From the Build menu, select Compile

  2. From the list of defined compiler definitions, select the correct compiler

  3. Click OK

Note

These instructions do not apply to files associated with the current project.


Compiling a Project File

Unlike unassociated files, project files do not prompt for a compiler definition; instead the compiler definition is specified in the project settings. In addition to the compiler, the project settings allow the actual command executed to be specified, which is ideal when the default compile command line does not meet your requirements.

For more information on compiling project files, see Developing Projects.


Highlighting Errors

The resulting output from a compile command can produce many hundreds of lines, even when successful. Examining every line of output for warnings or errors is not only time consuming, but missing a vital error can lead to many lost hours of precious development time.

The solution to this problem is to allow Programmer Studio to only identify possible warnings and errors in the compiler output, highlighting each offending line for closer examination. As Programmer Studio provides no specific compiler support, this detection of errors is achieved using regular expressions.

Regular Expressions

Regular expressions are ideal for identifying errors and warnings appearing in compiler output as they can be used to describe the general format of an error without being too specific.

Unlike finding text, the regular expressions used for error highlighting must also include special identifiers that indicate the position of file names and line numbers within the expression itself. In addition to the standard regular expression format characters, Programmer Studio uses the following variables to identify key elements in the compiler output.

To match | Use
The line index on which the error was detected. | <l>
The name of the file containing the error | <p> / <f>
The line number appearing on the line on which the error was detected. This is intended for COBOL compilers, etc. | <ln>
The name of the file containing the error in MPE format | <mp>
The line number on which the error was detected in MPE format | <mln>

The file name detected using the <p> variable is evaluated using the location at which the compile command was executed. This allows partial file names to be fully qualified.

The following examples illustrate how to create a regular expression to detect possible errors within the sample compiler output. To help in identification, the special expression variables appear in bold.

Output: | cc: "hello.c", line 3: error 1507: Function...
Expression: | ^cc: <f>, line <l>: error
Output: | /usr/examples/hello.c(3) : error...
Expression: | ^<f>\(<l>\) : error
Output: | File: /usr/examples/hello.c Line 3
Expression: | ^File: <f> ^Line <l>

Although the regular expressions are explained in great detail in Using Regular Expressions, there are some initial points of interest when discussing the examples above.

  • The circumflex character, ^, indicates the comparison must start at the beginning of a line.

  • The brackets used in example 2, must be prefixed with a back-slash character, as brackets are used in regular expressions to form groups.


Examining Resulting Errors

Using regular expressions to detect errors, Programmer Studio allows the user to quickly move forward and backward through the resulting output to the next and previous line matching the compiler error expression.

As each warning and error is highlighted, Programmer Studio will attempt to load the file containing the error, (if it is not already loaded), and highlight the line on which the error is determined to have occurred.

To highlight the next error in the compiler output

  1. Ensure the Output tab is activated in the Output Window

  2. From the Edit menu, select Go To, then Next Error/Tag (F4)

In addition to highlighting the first warning or error in the output window, Programmer Studio can also count the total number of detected errors.

To automatically highlight the first error in the output window

  1. From the Tools menu, select Options, Preferences

  2. Select the Build category

  3. Click Highlight the first error found

  4. Click OK


Visual File Compare

A common task among programmers, especially those working in a team, is to determine differences between various versions of the same code. This can be a very time consuming task which, when done by hand, is far from accurate.

Introduction

Programmer Studio does not include file comparison tools. Instead it provides a conduit to external utilities which output results in one of two recognized formats. Using an external utility has the distinct advantage of allowing the user to determine which of the many tools available to use, while still providing a standard visual interface to the results generated

When using file compare for the first time, Programmer Studio will prompt the user to select which compare utility to use, FC or DIFF. To change this at any time, use the File Compare category in the Options, Preferences dialog box.

Microsoft Windows FC.EXE

This uses the standard file compare utility installed as part of the Microsoft Windows operating system. FC is a good utility for comparing files reporting general differences, but lacks the accuracy of utilities written specifically for comparing line based files.

GNU DIFF (or compatible)

DIFF is a popular utility among UNIX users which has been ported to many non-UNIX platforms, including Windows. DIFF is a far more sophisticated "differencing" utility then FC, providing a number of additional options to generate a very accurate list of differences.

A version of DIFF is installed with Programmer Studio in the unsup sub-directory.


Comparing Files

Programmer Studio compares files by first loading each file, (if not already open), as they would be when edited normally. Once loaded, each file is subsequently saved on the PC removing any non-editable text, (line numbers and line tags), identified by the Code Editor template or file compare options. Finally, the file compare utility is invoked to compare the two files based on the compare options.

To compare two files

  1. From the Tools menu, select Compare Files

  2. In the File 1 field, enter the name of the first file to compare

  3. In the File 2 field, enter the name of the second file to compare

  4. From the options, select additional compare settings

  5. Click Compare to start the file comparison

Tip

Use the arrow button to the right of the File fields to browse for local or remote filenames or select from a list of currently open files.

The file comparison can be cancelled at any time by pressing the Stop button, or by selecting Stop from the View menu. Programmer Studio provides the following options for the file comparison:

Match case

This setting is passed to the comparison utility as an optional parameter. When selected, characters differing in case will be highlighted. By default this option is not enabled.

Ignore tabs and spaces

This setting is passed to the comparison utility as an optional parameter. When selected, multiple tab and space characters are treated as a single space when comparing lines. By default this option is enabled.

Ignore line numbers

This setting instructs Programmer Studio to remove any detected line numbers from the contents of a file prior to invoking the comparison utility. If either file is opened using a File Type that removes line numbering while editing, this option has no effect.

Specify File Type

This setting overrides the File Type that would normally be assigned to the file, either by the current project or using the file name. This is especially useful when comparing files that would not normally be opened with the correct Code Editor Template, ensuring that differences in non-editable code are not highlighted.


Comparison Results

Following a successful comparison, the differences tool window will be displayed and the first difference highlighted in the Code Editors of the two files. The key provides a visual indication of the difference highlighted, the starting line position and the number of lines highlighted.

The toolbar buttons allow the user to move forwards and backwards through the differences highlighted, and also change the orientation of the windows between portrait and landscape.


Integrated Debugging

Programmer Studio makes extensive use of the TELNET session created for a server profile to remotely control your chosen server-based debugger. Using menu items and dialog boxes to control the remote debugger further improves programming productivity especially when developing on multiple platforms.


How it Works

Programmer Studio is able to provide integrated debugging by assuming the role of a user controlling a debugger via the command line interface. Each debug feature, step into, quick watch, break, etc. is converted into the correct command line instruction and then sent to the debugger. The resulting response is then parsed and displayed to the user in the appropriate format.

Support for each specific debugger is provided by external DLL libraries. If you use a debugger that is not currently supported, please contact us and we will be happy to discuss possible solutions.


Getting Started

Programmer Studio provides integrated debugging as part of a Programmer Studio project, so you will need to have a project setup and ready to use before you can begin debugging. Please refer to Chapter 6, Developing Projects, in the Programmer Studio User Guide.

It is recommended that all source/list files included within the debug target (program) that may need to be opened within Programmer Studio should be included in the current project.

Before continuing, please also ensure that the target has indeed been compiled to include the information required by the debugger, or you have access to the relevant symbol or list files. For GDB this will usually involve specifying a compiler command line option that will include additional information in the program to be debugged. For HPe3000 debuggers this may involve creating a LISTFILE during the compile.


Project Debugger Settings

Before you can begin debugging a program you will need to select which symbolic debugger you use and provide details of the debug target and other information. The following section describes each of the debug settings in detail.

General Settings

The general category provides options that are required for basic debugger support. This section describes each field.

Symbolic Debugger

This drop-down determines the symbolic debugger that will be used. Depending upon the selection, the remaining fields in this tab will be active and the status of items in the Debug menu will change.

Program/Debug Target

This field specifies the target to be debugged. This is typically a program name although this may depend upon the selected debugger used.

Tip

Using the browse button to the right of the field will display the file dialog box. Selecting the debug target from here will automatically set both the Debug Target and Working Directory fields.

Program Arguments

This field determines the additional arguments that should be passed to the target program within the debugger. This should not be confused with arguments passed to the debugger itself.

Working Directory

This field determines the server profile and directory in which the debugger is executed. This is typically the location of the debug target but may be any valid directory location.

Prompt to Redirect Program Input/Output

This option prompts the user for a terminal identifier to which all debug target input and output is then subsequently redirected. This can be particularly useful when the program has complex I/O that may become confused with the debugger command line when allowed to run within the debug session tab in the output window.

Advanced

The advanced category specifies additional options for debugger execution. Only users familiar with the functionality of the target debugger should modify these settings.

Debugger Command Line

This field allows an advanced user to override the command that would normally be executed to start the host based debugger. This may be useful in circumstances where the debug command line requires a fully qualified location or requiring special options to be included.

The button to the right of the field provides a popup menu containing variables which may be used within the debugger command line, substituted for actual settings at run-time.

To | Use
Represent the program/debug target | $(DebugTarget)
Represent the arguments for the program/debug target | $(DebugTargetArgs)

In most cases the average user will probably not need to specify an alternate debugger command line. However for those users who wish to, the option is there.

Debug Source Location

This field provides Programmer Studio with the location of files identified by the debugger when stepping into a debug target or when a break is reached in program execution (as a result of step over, step into or reaching a breakpoint). Most debuggers identify files using a fully qualified filename. For those just displaying a filename, Programmer Studio requires a source directory to look in.

Execute Initial Debugger Commands

This field allows the user to enter any number of commands which should be executed from the debugger prompt prior to setting breakpoints and before the program is started within the debugger.

This can be very useful for setting debugger options which affect the execution of the program being debugged. These commands must not expect further input and must return the debugger to its normal input prompt after completion.


Debugging a Program

Once the Debug settings have been specified within the project settings, the user may set breakpoints and begin debugging the specified target. It should be remembered that all debuggers are different, and although Programmer Studio attempts to duplicate functionality across various platforms, no two debuggers behave exactly the same way.

Before you begin debugging, it is recommended that you familiarize yourself with the debugger you are intending to use. This document is not intended to be an in-depth guide to interactive debugging, simply to provide an introduction to the interface that Programmer Studio provides.

What do you want to know more about ?

  • Setting Breakpoints

  • Starting a Debug Session

  • Controlling the Debug Target

  • Ending a Debug Session

  • Accessing the Remote Debugger


Setting Breakpoints

Before debugging the specified target, most users wish to set breakpoints, - identified points within the target which, when reached, cause the debugger to suspend target execution offering options to the user.

Breakpoints may either be set by location, filename and line number, or by function/procedure entry point. Once the debugger has loaded the target, Programmer Studio will attempt to set these breakpoints, displaying an error message if any locations are invalid.

Setting a breakpoint within the Code Editor

A breakpoint can be easily set within the Code Editor by selecting Toggle Breakpoint from the Debug menu (F9). If the current line is already set as a breakpoint, this will remove the breakpoint. It is important to ensure the line highlighted is valid, as Programmer Studio will not be able to determine this for you. Your symbolic debugger documentation will provide details of what constitutes a valid Breakpoint line.

Setting a breakpoint within the Breakpoints Window

An alternative way to set a breakpoint is through the Breakpoints dialog box. This lists all breakpoints currently set, by either file name and line number, or by function/procedure name.

To display the Breakpoints window, from the Debug menu, select Breakpoints

See Also

  • Starting a Debug Session

  • Controlling the Debug Target

  • Ending a Debug Session

  • Accessing the Remote Debugger


Starting a Debug Session

Programmer Studio provides a number of entry points from which to debug the specified target:

  • To start the debug target and to stop only at specified breakpoints, from the Debug menu, select Start Debugging, then select Go.

  • To start the debug target suspended at the first accessible statement, from the Debug menu, select Start Debugging, then select Step Into.

  • To attach the debugger to an existing process running on the server (UNIX only), from the Debug menu, select Start Debugging, then select Attach to Process.

After selecting one of these options, Programmer Studio will connect to the server and invoke the chosen debugger with the relevant instructions. Programmer Studio will then wait for the remote debugger to display a specific prompt to indicate the debug target is suspended or the program has terminated.

See Also

  • Setting Breakpoints

  • Controlling the Debug Target

  • Ending a Debug Session

  • Accessing the Remote Debugger


Controlling the Debug Target

Programmer Studio will suspend all further debug options until it has detected that the debugger has suspended execution of the debug target (this may have happened as result of a breakpoint being reached or selecting to start the program suspended).

Once the debugger prompt has been identified, the main window's caption will be modified to include the text [break] and many of the remaining options on the debug menu will become enabled. Certain items will be dependant on the line and text highlighted in the Code Editor.

This section will describe the functionality of each debug menu item and how it should function. It is very important at this stage to remember that Programmer Studio is merely controlling the debugger on the server, and that you may enter your own commands in the debug session window.

References to current statement indicate the current position of execution of the debug target and not the current/selected line in the Code Editor.

Continue

This will continue the execution of the debug target.

Restart

This will restart the debug target keeping existing breakpoints.

Stop Debugging

This will terminate the debug target and exit the debugger, closing the TELNET session.

Break

This will attempt to suspend the execution of the debug target, locating the current statement and highlighting this within the Code Editor. In the event the current statement does not identify a filename and line number, the Call Stack is displayed.

Kill Debug Session

This will simply terminate the current TELNET session, which in turn should terminate the debugger and target on the server. This option should be used with caution and only in cases where Stop Debugging fails.

Step Into

This will attempt to step into the sub-procedure/function located on the current statement. If the current statement does not identify a sub-procedure/function, this may fail or Step Over (depending upon the debugger).

Step Over

This will attempt to execute the code represented by the current statement and break execution at the next statement in the current file. If there isn't a next statement in the current file, this may fail or highlight the next executable statement (depending upon the debugger).

Run to Cursor

This will attempt to set a temporary breakpoint at the statement on which the cursor entry point is located in the Code Editor and then continue program execution.

Set Next Statement

This will attempt to move the current statement to the statement on which the cursor entry point is located in the Code Editor without executing code in between. This should be used with caution as it may leave the debug target in an unusable state.

Show Next Statement

This will highlight the debug target's current statement in the Code Editor, opening any necessary files.

View Call Stack

This will activate the Call Stack output tab and display the call hierarchy for the current statement. Although the format of the output in the call stack window is dependant upon the debugger, the call hierarchy is listed downwards from the current function/procedure.

If the call stack output tab is active, the call stack is updated every time the debugger is suspended. If you are using the step over or step into functions, this may result in an obvious delay.

Tip

Double click on an item in the call stack window to highlight the specified line in the code editor.

View Locals

This will display the contents of all local variables (if applicable to the programming language) in their native format. Local variables that have component values are displayed with a plus symbol to the left of the variable name; this can be used to expand the variable value.

If the Locals output tab is active, the locals list is updated every time the debugger is suspended. If you are using the step over or step into functions, this may result in an obvious delay.

Note

In COBOL the Locals window typically displays all variables defined within the entire WORKING-STORAGE section of the program, and as such should be avoided.

Quick Watch

This will display the Quick Watch dialog box. This evaluates the currently selected text or the keyword at the insertion point in the Code Editor. The results of the evaluation will then be displayed in the native format.

Within the Quick Watch window a watch may be placed on the specified expression. This will then be evaluated in the Watch output window every time the debug target enters a suspended state.

Tip

The size of the quick watch dialog box can be altered by clicking and dragging the size handle in the bottom right hand corner.

Quick Watch Tool Tips

In addition to the Quick Watch dialog, Programmer Studio can also display expression evaluation simply by placing the mouse pointer over a variable while pressing the CTRL key.

The content of the quick watch tool-tip is limited to a single line; expressions which have a value expressed in more than one line are not displayed.

Tip

Additional quick watch tool-tip options are available in the Preferences dialog in the Debug category. These include the option to disable the requirement for the CTRL key to be pressed.

See Also

  • Setting Breakpoints

  • Starting a Debug Session

  • Ending a Debug Session

  • Accessing the Remote Debugger


Ending a Debug Session

The current debug session may be terminated either normally, by the program being debugged terminating, by instructing the debugger to end the debug session, or by terminating the debug session itself.

A debug session should only be 'killed' in the event Programmer Studio becomes confused as to the state the debugger is currently in. For example, in the event the debugger is terminated on the server.

See Also

  • Setting Breakpoints

  • Starting a Debug Session

  • Controlling the Debug Target

  • Accessing the Remote Debugger


Accessing the Remote Debugger

Advanced users can also access the remote debugger directly using the session window that is displayed by selecting the output tab with the server profile name. Using the session window you can access information not provided by the standard menu items, for example, changing local/active variables or viewing advanced information such as registers.

The debugger should only be accessed from the session window while Programmer Studio assumes the debugger is suspended (this can be determined by the presence of [break] in the Programmer Studio window caption).

Note

Care should be taken when accessing the remote debugger from the session window as this may leave Programmer Studio unable to determine the current state of the remote debug session. In the event that a command is used which changes the current statement, select Show Current Statement from the Debug menu.

See Also

  • Setting Breakpoints

  • Starting a Debug Session

  • Controlling the Debug Target

  • Ending a Debug Session


Using Regular Expressions

Programmer Studio makes extensive use of regular expressions as a solution to the problem of matching text that is not constant. Regular expressions can be used when searching for text in a document, specifying the format of TELNET command prompts, and defining the format of errors in a compilers output.

This chapter is intended to provide a basic introduction to regular expressions. If you are keen to learn more about the power of regular expressions there are many books and online resources dedicated to this subject alone!

What do you want to know more about ?

  • Introducing Regular Expressions

  • Simple Expressions

  • Character Classes

  • Special Character Classes

  • Repeating Patterns

  • Optional Expressions

  • Alternatives

  • Grouping

  • Predefined Compound Expressions


Introducing Regular Expressions

Regular expressions provide a flexible approach to matching text. They can be very simple, such as f.r, which finds any three letter word beginning with f and ending in r. Or it can be very complex, with several parts described in parentheses that are individually evaluated.

By combining small expressions to form larger complex (compound) expressions, you can create very specific search criteria. For example, you can find any word beginning with pre which also ends with ed, such as pretended or presented.

Regular expressions can be used to match text that can vary between occurrences. For example, searching for a particular assignment operation that has been typed with varying amounts of white space, is now possible using regular expressions.

See Also

  • Simple Expressions

  • Character Classes

  • Special Character Classes

  • Repeating Patterns

  • Optional Expressions

  • Alternatives

  • Grouping

  • Predefined Compound Expressions


Simple Expressions

In its most simple form, a simple expression consists of one or more characters. For example,

a
if
move
while

A sequence of characters is called a character string.

See Also

  • Introducing Regular Expressions

  • Character Classes

  • Special Character Classes

  • Repeating Patterns

  • Optional Expressions

  • Alternatives

  • Grouping

  • Predefined Compound Expressions


Character Classes

A character class is a number of characters enclosed in square brackets. For example,

[0123456789]

matches any one of the characters inside the brackets. This character class matches any single digit. This digit character class can be written more simply as:

[0-9]

The '-' indicates a range of characters between the '0' and '9'. The order in which a range of characters is specified is related to the order in which characters appear in the ASCII character set. A complete list of the 7-bit ASCII characters can be found in Appendix A.

Another example of a range within a character class is,

[a-z]

this would match any lower case character, while

[a-zA-Z]

would match any uppercase or lowercase character.

If the first character after the '[' is a circumflex ( ^ ), the character class matches all characters which are not listed in the brackets. For example,

[^0-9]

would match all characters that are not digits.

Note

A '-' or ']' as the first character after the '[' is interpreted literally to allow the user to include dashes and square brackets in character classes.

See Also

  • Introducing Regular Expressions

  • Simple Expressions

  • Special Character Classes

  • Repeating Patterns

  • Optional Expressions

  • Alternatives

  • Grouping

  • Predefined Compound Expressions


Special Character Classes

The period ( . ) character class matches any single character except a new line. For example,

f.r

would match any three character string starting with an 'f' and ending with a 'r'.

See Also

  • Introducing Regular Expressions

  • Simple Expressions

  • Character Classes

  • Repeating Patterns

  • Optional Expressions

  • Alternatives

  • Grouping

  • Predefined Compound Expressions


Repeating Patterns

Any regular expression, either simple or compound, followed by an asterisk, indicates that zero or more repetitions of the regular expression will be matched. For example,

[0-9][0-9]*

matches a pattern of characters starting with a digit, followed by zero or more additional digits. This is a typical example of a regular expression used to match a pattern of characters representing a typical number.

[A-Z][a-z]*

The regular expression above matches an uppercase letter followed by zero or more lowercase letters.

The '+' character can be used in a similar manner to '*' to match one or more repetitions of the preceding regular expression. For example,

[0-9]+

matches a sequence of one or more digits, which is the same as the previous example,

[0-9][0-9]*

Using the brace brackets you can specify a specific number or repetitions for a regular expression. For example,

[0-9]{3}

matches a sequence of three digits. A range of repetitions can be defined within the brace brackets. For example,

[0-9]{1,10}

matches a sequence of 1 to 10 digits.

See Also

  • Introducing Regular Expressions

  • Simple Expressions

  • Character Classes

  • Special Character Classes

  • Optional Expressions

  • Alternatives

  • Grouping

  • Predefined Compound Expressions


Optional Expressions

A regular expression immediately followed by a question mark ( ? ) makes the expression optional. For example

A?

matches 0 or 1 occurrence of the letter 'A'.

See Also

  • Introducing Regular Expressions

  • Simple Expressions

  • Character Classes

  • Special Character Classes

  • Repeating Patterns

  • Alternatives

  • Grouping

  • Predefined Compound Expressions


Alternatives

Two regular expressions, simple or compound, may be separated by a vertical bar ( | ) to produce an expression that matches either one of the expressions. For example,

[a-z]|[A-Z]

matches either a single lowercase or uppercase letter.

See Also

  • Introducing Regular Expressions

  • Simple Expressions

  • Character Classes

  • Special Character Classes

  • Repeating Patterns

  • Optional Expressions

  • Grouping

  • Predefined Compound Expressions


Grouping

Using parentheses, expressions may be grouped together. For example,

(top|middle|bottom)

matches any of the strings top, middle or bottom. Grouping is especially useful when constructing compound regular expressions which use one or more of the expressions described above. For example,

([A-Za-z_][A-Za-z0-9_]*)|(-?+?[0-9])

matches any C style identifier or any integer constant.

See Also

  • Introducing Regular Expressions

  • Simple Expressions

  • Character Classes

  • Special Character Classes

  • Repeating Patterns

  • Optional Expressions

  • Alternatives

  • Predefined Compound Expressions


Predefined Compound Expressions

Programmer Studio provides a number of predefined compound regular expressions for matching common string patterns. These greatly simplify the task of building a compound regular expression.

To match | Use
An alphanumeric character | \:a
An alphabetic character | \:c
A control character | \:n
A numeric character | \:d
A graphical character | \:g
A lowercase character | \:l
An uppercase character | \:u
A printable character | \:p
White-space character | \:b
Hexadecimal character | \:h
Any string enclosed in quotes, such as ‘sample’ or “sample” | \:q
Any string enclosed in single quotes, such as ‘sample’ | \:QS
Any string enclosed in double quotes, such as “sample” | \:QD

See Also

  • Introducing Regular Expressions

  • Simple Expressions

  • Character Classes

  • Special Character Classes

  • Repeating Patterns

  • Optional Expressions

  • Alternatives

  • Grouping


License Agreement

Copyright © 2001 Whisper Technology Limited. All rights reserved.

Whisper Technology licenses this Software to you only upon the condition that you accept all of the terms contained in the License Agreement below. If you do not agree to all these terms, then please remove the Software from your system.

Definitions

"Software" means all the software items supplied including programs, dictionaries, indexes, data files, help files, tutorial and sample programs, files, databases, forms and reports.

"Client Software" means that subset of the Software installed on a user's PC.

Where applicable, "Server Software" means that subset of the Software installed on servers on the network.

"Registration Codes" are those codes or keys supplied to you on purchase of a license for the Software. The Registration Codes confirm the Software as licensed and register the Software with your name.

Whisper Technology Limited ("Whisper Technology") is the owner of the copyright and other rights in the Software and is, accordingly, the licensor of the Software.

"You" are the person evaluating or acquiring the Software, and are, accordingly, the licensee in respect of it.

License Agreement

Prior to payment of the applicable license fees, Whisper Technology permits you to install and run the unregistered Software for the sole purpose of evaluating whether to purchase a license for the Software. This evaluation period is limited to a maximum period of 30 days after which you should either purchase a license for the Software or uninstall and delete all copies of the Software.

Subject to purchase of a license and payment of the applicable license fees, Whisper Technology grants you a non-exclusive, non-transferable license to install and run the Software. On purchase of a license for the Software, Whisper Technology will supply Registration Codes to confirm the Software as licensed and to register the Software with your name.

The Client Software may be installed and run only on a single computer for each copy of the Software licensed.

Where applicable, the Server Software may be installed and run on any number of servers.

Where you use a computer at work and a separate computer at home then you may also install and run the Client Software on the second computer at home so long as only one copy is run at a time.

The Software may be copied for back-up or archival purposes provided that any copies of the Software are clearly labeled as such and include a prominent notice to the effect that Whisper Technology is the copyright owner.

You may freely copy the evaluation Software, or upload the Software to any newsgroup, forum, web-site, ftp server, magazine cover disk or CD, etc., but only in its original distribution format, as downloaded from our website, and without modification, to other individuals for their evaluation purposes. In no circumstances may you charge, or request donations, for any such copies.

In no circumstances may you copy or in any other way provide any Registration Codes supplied to you by Whisper Technology to any other person.

In the event that your Registration Codes are used by another person or organization, then Whisper Technology reserves the right to cancel your license and terminate this agreement. In such circumstances, Whisper Technology reserves the right to prohibit your use of the Software and new versions of the Software.

You shall take all reasonable precautions and measures to protect the Software and Registration Codes from unauthorized use, access, copying, modification, reproduction, distribution or publication.

No title to, or ownership of, the Software is transferred to you.

Prohibited Uses

You may not make copies of the Software and Registration Codes except as provided above.

You may not assign, rent, lease, lend, resell, share, license or transfer the Software.

You may not decompile, disassemble, reverse engineer, or otherwise modify the Software, save as provided for under local law. Any additional information required for interoperability of the Software has been provided in the documentation or is readily available from Whisper Technology on request.

Termination

You may terminate this agreement at any time by discontinuing all use of the Software and permanently uninstalling and deleting or destroying all copies of the Software.

Whisper Technology may terminate this agreement at any time following a breach of this agreement and/or infringement of Whisper Technology's copyright.

Warranty

Whisper Technology warrants that the Software, when correctly installed, will perform in substantial accordance with the documentation provided for a period of 90 days after licensing of the Software. Whisper Technology does not warrant that the operation of the Software will be uninterrupted or error free.

You are entitled to download and run any new releases or versions released during the 90 day warranty period.

Whisper Technology's sole liability under any breach of this Warranty is to replace a defective copy of the Software or to refund the license fee paid for the Software.

Subscription Program

If you purchase the Subscription Program, you are entitled to download and run any new releases or versions of the licensed Software released during the described term of the Subscription Program.

Liability

You are entirely responsible for determining the suitability of the Software for your purposes and for the use that you make of the Software.

Whisper Technology are not liable for any loss or direct, indirect, special or consequential damages arising from the use of the Software, however caused, save that provided for under local law.

Entire Agreement

This agreement represents the entire agreement between Whisper Technology and you and supersedes all previous agreements or representations whether written or oral.

Trademarks

Other brands or products are trademarks or registered trademarks of their respective holders and should be treated as such.

Applicable Law

This agreement is subject to the laws of England.


Ordering Information

Programmer Studio is available for immediate online licensing. To place an order for Programmer Studio, please visit our Web site at http://www.programmerstudio.com/buy.asp to:

  • Place a secure credit card order, or

  • Email us the order details, or

  • Print out a completed order form to fax to us

All orders are subject to terms in the Programmer Studio license agreement.

Programmer Studio | $299.00
Includes 3 months free upgrades. |
Programmer Studio Subscription Program | $100.00
Provides additional 12 months free upgrades. |


WTRSH

While FTP provides all the features necessary to navigate and transfer files on most platforms, the HPe3000 (a mini-computer from Hewlett-Packard) employs a very unique file system which is not adequately supported by FTP. WTRSH provides a solution to this problem by implementing a proprietary protocol which allows all HPe3000 file types to be opened, save or created.

In addition to simply supporting the various MPE file modes, variable, fixed, ASCII, binary and byte-stream files, WTRSH also supports SPOOL files, transparent COPYLIBs and even access to Qedit® files.

If you are not programming on an HPe3000, you will definitely not need WTRSH.

Where to get WTRSH

WTRSH can be downloaded from the web site, http://www.programmerstudio.com/download.asp

Licensing WTRSH

WTRSH is supplied free for use with Programmer Studio and can be installed on any number of HP3000s without charge.